Sort images by time