Update gallery for sorting