added conditionally loading of images