diff --git a/src/Plugin/Field/FieldFormatter/RemoteImageFormatter.php b/src/Plugin/Field/FieldFormatter/RemoteImageFormatter.php
index 33560bb..035cc0c 100644
--- a/src/Plugin/Field/FieldFormatter/RemoteImageFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/RemoteImageFormatter.php
@@ -61,11 +61,19 @@ class RemoteImageFormatter extends FormatterBase {
 
     // Add one image per item.
     foreach ($items as $delta => $item) {
+
+        if ($item->width == 0 || $item->height == 0){
+            list($width, $height) = getimagesize($item->uri);
+        }else{
+            $width = $item->width;
+            $height = $item->height;
+        }
+
       $elements[$delta] = [
         '#theme' => 'image',
         '#uri' => $item->uri,
-        '#width' => $item->width,
-        '#height' => $item->height,
+        '#width' => $width,
+        '#height' => $height,
         '#attributes' => ['class' => ['remote-image-item']],
       ];
       // Set the title field.
