Fixed latest and popular photos queries