Fixing performance issues with fancybox