dynamically add background when images are loaded