fix up some updating bugs in gallery