BZ-8628: fix npe on neGallery directive