Sort images based on date and location