diff --git a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
index 232f1a8..330d826 100644
--- a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
+++ b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
@@ -188,14 +188,15 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
     $image_style_setting = $this->getSetting('image_style');
 
     // Collect cache tags to be added for each item in the field.
-    $cache_tags = array();
+    $base_cache_tags = [];
     if (!empty($image_style_setting)) {
       $image_style = $this->imageStyleStorage->load($image_style_setting);
-      $cache_tags = $image_style->getCacheTags();
+      $base_cache_tags = $image_style->getCacheTags();
     }
 
     foreach ($files as $delta => $file) {
-      $cache_contexts = array();
+      $cache_contexts = [];
+      $cache_tags = $base_cache_tags;
       if (isset($link_file)) {
         $image_uri = $file->getFileUri();
         // @todo Wrap in file_url_transform_relative(). This is currently
diff --git a/core/modules/image/tests/src/Kernel/ImageItemTest.php b/core/modules/image/tests/src/Kernel/ImageItemTest.php
index dea4534..85aa212 100644
--- a/core/modules/image/tests/src/Kernel/ImageItemTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageItemTest.php
@@ -129,4 +129,21 @@ public function testImageItem() {
     $this->assertEqual($entity->image_test->entity->get('filemime')->value, 'image/jpeg');
   }
 
+  /**
+   * Tests the cache tags from image fields.
+   */
+  function testImageFieldCacheTags() {
+    // Create a test entity with the image field set.
+    $entity = EntityTest::create();
+    $entity->image_test->generateSampleItems(2);
+    $entity->name->value = $this->randomMachineName();
+    $entity->save();
+    $entity = EntityTest::load($entity->id());
+
+    // Generate the render array to verify if the cache tags are as expected.
+    $build = $entity->image_test->view([]);
+    $this->assertEqual($entity->image_test[0]->entity->getCacheTags(), $build[0]['#cache']['tags'], 'First image cache tags is as expected');
+    $this->assertEqual($entity->image_test[1]->entity->getCacheTags(), $build[1]['#cache']['tags'], 'Second image cache tags is as expected');
+  }
+
 }
