Created a function for loading images