diff --git a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
index 55b613a..eb75570 100644
--- a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
+++ b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
@@ -14,6 +14,7 @@
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Url;
+use Drupal\file\FileInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Cache\Cache;
@@ -189,16 +190,14 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
       $link_file = TRUE;
     }
 
-    $image_style_setting = $this->getSetting('image_style');
-
-    // Collect cache tags to be added for each item in the field.
-    $cache_tags = array();
-    if (!empty($image_style_setting)) {
-      $image_style = $this->imageStyleStorage->load($image_style_setting);
-      $cache_tags = $image_style->getCacheTags();
+    if ($image_style_id = $this->getSetting('image_style')) {
+      $image_style = $this->imageStyleStorage->load($image_style_id);
     }
 
+    /** @var \Drupal\file\FileInterface $file */
     foreach ($files as $delta => $file) {
+      $use_image_style = isset($image_style) && $this->useImageStyle($file);
+
       $cache_contexts = array();
       if (isset($link_file)) {
         $image_uri = $file->getFileUri();
@@ -210,7 +209,11 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
         $url = Url::fromUri(file_create_url($image_uri));
         $cache_contexts[] = 'url.site';
       }
-      $cache_tags = Cache::mergeTags($cache_tags, $file->getCacheTags());
+      $cache_tags = $file->getCacheTags();
+      if ($use_image_style) {
+        /** @var \Drupal\image\ImageStyleInterface $image_style */
+        $cache_tags = Cache::mergeTags($cache_tags, $image_style->getCacheTags());
+      }
 
       // Extract field item attributes for the theme function, and unset them
       // from the $item so that the field template does not re-render them.
@@ -222,16 +225,32 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
         '#theme' => 'image_formatter',
         '#item' => $item,
         '#item_attributes' => $item_attributes,
-        '#image_style' => $image_style_setting,
         '#url' => $url,
         '#cache' => array(
           'tags' => $cache_tags,
           'contexts' => $cache_contexts,
         ),
       );
+      if ($use_image_style) {
+        /** @var \Drupal\image\ImageStyleInterface $image_style */
+        $elements[$delta]['#image_style'] = $image_style->id();
+      }
     }
 
     return $elements;
   }
 
+  /**
+   * Determines if the configured image style should be applied to a file.
+   *
+   * @param \Drupal\file\FileInterface $file
+   *   The file entity being displayed.
+   *
+   * @return bool
+   *   Whether to use the configured image style.
+   */
+  protected function useImageStyle(FileInterface $file) {
+    return $file->getMimeType() !== 'image/svg+xml';
+  }
+
 }
