Displaying photos in the gallery by date