fix for gallery issue