add an explicit order by to the gallery query

as of nov 1 we appear to have been selecting data out of order. This lead to statistics being dropped in the transfer from gallery to warehouse databases