added more logging for crash debugging
sort photos in gallery by timestamp