it isn't just Mohammad, they disapprove of showing any living beings. That's why Muslim ar tends to be decorative rather than representational. They don't like strangers taking photos of them. There's a similar line in the ten commandments about not making graven images of God. Once you take a photo of someone, you control a little bit of them - you can show it to people they don't even know, who can judge you on your outward appearance, for instance.
Giving a child one name or another is a different issue.