fix for infinite loop in accessors for gallery object