Updated Gallery functionality