diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js
index 4385e37ac0ae8d0d6680b8cb08ad27f70f47851f..34cbd39eff804f1bf15ced403f4acf96b0563c0a 100644
--- a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js
+++ b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js
@@ -71,7 +71,9 @@ define([
             this.options.values = this.options.spConfig.defaultValues || {};
             this.options.parentImage = $('[data-role=base-image-container] img').attr('src');
 
-            this.initialGalleryImages = $(this.options.mediaGallerySelector).gallery('option', 'images');
+            this.initialGalleryImages = $(this.options.mediaGallerySelector).data('mageGallery')
+                ? $(this.options.mediaGallerySelector).gallery('option', 'images')
+                : [];
             this.inputSimpleProduct = this.element.find(this.options.selectSimpleProduct);
         },