Order gallery by id