Updated Gallery to have new sort functions