Add Ability to Control the maximum number of images in a gallery