fix / update for broken gallery sorting