fix for gallery js not loading in production