LPS-34574 Fix Upgrade ImageGallery with sharding