added for loop to enumerate over the image list to make sure the images are in the correct order