update gallery directive