photos ordering from query