Fix for gallery rendering