You can do css mapping. Look at all the parents and find one with a class you can handle, then map it down appropriately For instance:
div class = grandparent
ul
li
a
img
can be targetted as
/*to affect only the one directly under this parent class */
div.grandparent > ul > li > a > img {
margin:0 auto;
}
/*to affect all under this parent class */
div.grandparent ul li a img {
margin:0 auto;
}