Your gmail messages live on Google's servers. It's not ok for them to scan everything, but it's completely different from Apple scanning your phone's content.
(Not trying to make a counter-argument to your comment. I genuinely don't get this part).
I'm not sure how the image is displayed on the parents' device - it could be sent from the child's device, or the image used to compute the hash that the child's image matched could be displayed.