[ADDED] Ability to set a maximum number of images to cache