I'm always pleased to help foreign people to understand our beautiful language.
Look, it's very easy, let's use as example the word "instalar" that translated to english is "install"
EXAMPLE: "I'm going to install this in here" --- "Voy a instalar esto aquí"
If I say: "Voy a instalarle esto" it means: "I'm going to install this TO YOU " but it can also means: "I'm going to install this TO HER" or "I'm going to install this TO HIM"
In the other hand, if I say: "Voy a instalarlo" it means: "I'm going to install it"
Look that if I use "lo" in english is like putting the pronoun "it" at the end.
But when I use "le" I'm refering to another person, it can be YOU, it can be HER or it can be HIM.
Wait a minute! beacuse unfortunately is not that easy because there are some sentences that "le" or "lo" are ok in any context, for example in your sentence "La imagen refuerza ciertos estereotipos comunes en Estados Unidos de negros, pintándoles de ignorantes etc." is ok to use "le" or "lo".
It depends on the sentence. You will only understand what I'm saying living too much time in a spanish speaking country. But for ease of terms you can use the rule I explained above. I hope you have understood me. Thanks!