Set max width/height for gallery images