Improved gallery performance