diff --git a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
index 55b613a..acbf840 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,12 @@ 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();
-    }
-
+    /** @var \Drupal\file\FileInterface $file */
     foreach ($files as $delta => $file) {
+      // Determine which image style to use.
+      $image_style = $this->getImageStyle($file);
+      $cache_tags = $image_style ? $image_style->getCacheTags() : [];
+
       $cache_contexts = array();
       if (isset($link_file)) {
         $image_uri = $file->getFileUri();
@@ -222,16 +219,36 @@ 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 ($image_style) {
+        $elements[$delta]['#image_style'] = $image_style->id();
+      }
     }
 
     return $elements;
   }
 
+  /**
+   * Gets the image style which should be applied to a given file.
+   *
+   * @param \Drupal\file\FileInterface $file
+   *   The file entity being displayed.
+   *
+   * @return \Drupal\image\ImageStyleInterface|NULL
+   *   The image style to use, or NULL if no style should be used.
+   */
+  protected function getImageStyle(FileInterface $file) {
+    if ($file->getMimeType() != 'image/svg+xml') {
+      $image_style = $this->getSetting('image_style');
+      if ($image_style) {
+        return $this->imageStyleStorage->load($image_style);
+      }
+    }
+  }
+
 }
