Improved the way Q/gallery hides images not in use