Added JS code to load images