bug fix when gallery.owner = nil