Created the function to grab the images.