sort the images in sequential order