For example, Sahih Muslim vol.3 no.5268 (p.1160) says, ‘Ibn ‘Umar reported Allah’s Messenger (may peace be upon him) having said: Those who paint pictures would be punished on the Day of Resurrection and it would be said to them: Breathe soul into what you have created.2519’
Notice that the prohibition was not just against idolators who made pictures, or even Muslims who made pictures for other reasons, but for anyone who made pictures.
Sahih Muslim vol.3 no.5271 (p.1161) gives a little more detail: ‘This hadith has been reported on the authority of Abu Mu’awiya though another chain of transmitters (and the words are): ‘Verily the most grievously tormented people amongst the denizens [inhabitants] of Hell on the Day of Resurrection would be the painters of pictures.2520…’
‘Narrated ‘Aisha: Allah’s Apostle said, ‘The painter of these pictures will be punished on the Day of Resurrection, and it will be said to them, Make alive what you have created.’’ Bukhari vol.9 book 93 no.646 p.487. no.647 p.487 is the same except it is narrated by Ibn ‘Umar.
No pictures of people or animals according to Bukhari vol.4 book 54 no.447-450 p.297-299.
Conclusion: It is clear that the hadiths prohibit pictures of animals or people, especially in homes. There is no focus on pictures of Muhammad per se. All pictures of people and animals are forbidden. It is a completely general prohibition.”