Optimize Gallery