Changes to the function to get the images from the directory.