diff --git a/core/lib/Drupal/Core/Image/Image.php b/core/lib/Drupal/Core/Image/Image.php
index a515fe4..7f8c5df 100644
--- a/core/lib/Drupal/Core/Image/Image.php
+++ b/core/lib/Drupal/Core/Image/Image.php
@@ -100,8 +100,25 @@ public function __construct($source, ImageToolkitInterface $toolkit) {
    * {@inheritdoc}
    */
   public function getExtension() {
-    $this->processInfo();
-    return $this->extension;
+     $this->processInfo();
+
+    	//added new extension
+	//it is better to accept some more extentions ..
+    if (empty($this->extension) && ($extension = pathinfo($this->getSource(), PATHINFO_EXTENSION))) {
+      if (in_array($extension, array('gif', 'jpg', 'png','webp'))) {
+        $this->extension = $extension;
+      }
+    }
+
+     return $this->extension;
+   }
+
+/**
++   * {@inheritdoc}
++   */
+  public function setExtension($extension) {
+    $this->extension = $extension;
+    return $this;
   }
 
   /**
