diff --git a/src/org/openstreetmap/josm/gui/layer/geoimage/viewers/projections/Equirectangular.java b/src/org/openstreetmap/josm/gui/layer/geoimage/viewers/projections/Equirectangular.java
index f76b252344..de69efdc14 100644
--- a/src/org/openstreetmap/josm/gui/layer/geoimage/viewers/projections/Equirectangular.java
+++ b/src/org/openstreetmap/josm/gui/layer/geoimage/viewers/projections/Equirectangular.java
@@ -47,6 +47,9 @@ public class Equirectangular extends ComponentAdapter implements IImageViewer {
         g.drawImage(currentOffscreenImage, target.x, target.y, target.x + target.width, target.y + target.height,
                 visibleRect.x, visibleRect.y, visibleRect.x + visibleRect.width, visibleRect.y + visibleRect.height,
                 null);
+        if (currentOffscreenImage.getWidth() != image.getWidth() || currentOffscreenImage.getHeight() != image.getHeight()) {
+            this.updateBufferedImageSize(image.getWidth(), image.getHeight());
+        }
     }
 
     @Override
@@ -62,29 +65,8 @@ public class Equirectangular extends ComponentAdapter implements IImageViewer {
     @Override
     public void componentResized(ComponentEvent e) {
         final Component imgDisplay = e.getComponent();
-        if (e.getComponent().getWidth() > 0
-                && e.getComponent().getHeight() > 0) {
-            // FIXME: Do something so that the types of the images are the same between the offscreenImage and
-            // the image entry
-            final CameraPlane currentCameraPlane;
-            synchronized (this) {
-                currentCameraPlane = this.cameraPlane;
-            }
-            final BufferedImage temporaryOffscreenImage = new BufferedImage(imgDisplay.getWidth(), imgDisplay.getHeight(),
-                    BufferedImage.TYPE_4BYTE_ABGR);
-
-            Vector3D currentRotation = null;
-            if (currentCameraPlane != null) {
-                currentRotation = currentCameraPlane.getRotation();
-            }
-            final CameraPlane temporaryCameraPlane = new CameraPlane(imgDisplay.getWidth(), imgDisplay.getHeight());
-            if (currentRotation != null) {
-                temporaryCameraPlane.setRotation(currentRotation);
-            }
-            synchronized (this) {
-                this.cameraPlane = temporaryCameraPlane;
-                this.offscreenImage = temporaryOffscreenImage;
-            }
+        if (imgDisplay.getWidth() > 0 && imgDisplay.getHeight() > 0) {
+            this.updateBufferedImageSize(imgDisplay.getWidth(), imgDisplay.getHeight());
             if (imgDisplay instanceof ImageDisplay) {
                 ((ImageDisplay) imgDisplay).updateVisibleRectangle();
             }
@@ -92,6 +74,35 @@ public class Equirectangular extends ComponentAdapter implements IImageViewer {
         }
     }
 
+    /**
+     * Update the buffered image size
+     * @param width The width to use
+     * @param height The height to use
+     */
+    private void updateBufferedImageSize(final int width, final int height) {
+        final CameraPlane currentCameraPlane;
+        synchronized (this) {
+            currentCameraPlane = this.cameraPlane;
+        }
+        // FIXME: Do something so that the types of the images are the same between the offscreenImage and
+        // the image entry
+        final BufferedImage temporaryOffscreenImage = new BufferedImage(width, height,
+                BufferedImage.TYPE_4BYTE_ABGR);
+
+        Vector3D currentRotation = null;
+        if (currentCameraPlane != null) {
+            currentRotation = currentCameraPlane.getRotation();
+        }
+        final CameraPlane temporaryCameraPlane = new CameraPlane(width, height);
+        if (currentRotation != null) {
+            temporaryCameraPlane.setRotation(currentRotation);
+        }
+        synchronized (this) {
+            this.cameraPlane = temporaryCameraPlane;
+            this.offscreenImage = temporaryOffscreenImage;
+        }
+    }
+
     @Override
     public void mouseDragged(final Point from, final Point to, ImageDisplay.VisRect currentVisibleRect) {
         if (from != null && to != null) {
