Fixing & optimizing image gallery