gallery fix bug