If the logo or image is small or hidden and does not show clear details of the eyes or mouth then it is considered permissible. For example, some shirts with the logo of Ralph Lauren are just a mere shadow and nothing else appears, this is okay. The problem arises when there is a clear image like Lacoste where the alligator is clearly distinguished.
In the Sahih hadith narrated by Abu Talha: The Prophet (ﷺ) said, “Angels do not enter a house in which there is a dog or there are pictures.” 
From this hadith the teaching of the Prophet is quite clear, pictures are disliked and to have pictures in your home minimizes the blessings you could receive. In a similar manner wearing clothes with images would not make for optimum praying conditions.
In another hadith, narrated by Anas: Aisha had a thick curtain (having pictures on it) and she screened the side of her house. The Prophet (ﷺ) said to her, “Remove it from my sight, for its pictures are still coming to my mind in my prayers.”  and in Sahih al-Bukhari 6109 it was said, “His face got red with anger, and then he got hold of the curtain and tore it into pieces.” 
Narrated Ibn Abbas: I heard Muhammad saying, “Whoever makes a picture in this world will be asked to put life into it on the Day of Resurrection, but he will not be able to do so.” 
Pictures (tasweer) are disliked or makruh. The scholars generally agree that the Salah is still valid. Some argue if one knowingly and deliberately wears clothing with cartoon or animate beings like people or animals then it could be considered a minor sin. If he or she does so unknowingly out of ignorance then it is forgiven.
What Does It Say In the Quran?
The Qur’an does not have any verses directly forbidding images, this is discussed primarily in the hadith. But the Quran does state in Surah An Nisa Ayah 59,
“O you who have believed, obey Allah and obey the Messenger and those in authority among you. And if you disagree over anything, refer it to Allah and the Messenger, if you should believe in Allah and the Last Day. That is the best [way] and best in result.” 
The Quran does make mention to how a Muslim should dress for Salah,
“O Children of Adam! wear your beautiful apparel at every time and place of prayer.” 
What is proper dress for salah? For one it is making sure to cover the awrah (private parts) of the body. For men this would be from the naval to the knees. For women this is the entire body besides the hands and face. We want to make sure we are covered, but this verse also cites that we should be giving a decent appearance. We should be wearing nice clean clothes.
When it comes to Salat, we need to be cognizant that we are presenting ourselves to our Lord. If you remember that one detail ask yourself would you dress in a shirt with the cartoon of Homer Simpson or would you dressed in something much better?
Be well-dressed and clean is favorable and a step forward to perfecting the salat.
If are already outside your home and have come to the masjid for congregational prayer and you notice your shirt has an image, you can flip the shirt inside out. This is acceptable and your Salah will still be valid. But generally, you should want to avoid this scenario. To not repeat the same mistake twice it is advised to carry an extra shirt in your car that you can change into.
Hopefully this was informative to you, if you have any questions or remarks please leave leave them in the comments below.
1. Reference: Sahih al-Bukhari 5949 Grade: Sahih (Darussalam) also Sunan an-Nasa’i 4282.
2. Reference: Sahih al-Bukhari 5959
3. Narrated `Aisha: The Prophet (ﷺ) entered upon me while there was a curtain having pictures (of animals) in the house. His face got red with anger, and then he got hold of the curtain and tore it into pieces. The Prophet (ﷺ) said, “Such people as paint these pictures will receive the severest punishment on the Day of Resurrection.” Sahih al-Bukhari 6109
4. Reference: Sahih al-Bukhari 5963
5. Surah An Nisa Ayah 59
6. Surah Al A’raf Ayah 31