Added function to dynamically load images