Messy add image loop to for slatwall gallery.  You need to pick this apart a bit to see what is going on.