Add dynamic class structure to background images