diff --git a/vendor/magento/magento2-base/lib/web/mage/gallery/gallery.js b/vendor/magento/magento2-base/lib/web/mage/gallery/gallery.js
index 5872be6e4689e..2702ebdd1b7b2 100644
--- a/vendor/magento/magento2-base/lib/web/mage/gallery/gallery.js
+++ b/vendor/magento/magento2-base/lib/web/mage/gallery/gallery.js
@@ -1,6 +1,6 @@
 /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
+ * Copyright 2015 Adobe.
+ * All rights reserved.
  */
 
 define([
@@ -120,6 +120,14 @@ define([
             config.options.swipe = true;
             this.config = config;
 
+            // Check for multiple instances of jQuery
+            if (typeof jQuery !== 'undefined' && jQuery !== $ && typeof $.fn.fotorama === 'undefined') {
+                // Try to use the global jQuery instance
+                if (typeof window.jQuery !== 'undefined') {
+                    $ = jQuery.noConflict();
+                }
+            }
+
             this.settings = {
                 $element: $(element),
                 $pageWrapper: $('.page-wrapper'),
