Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java	(revision 16185)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java	(revision 16186)
@@ -12,4 +12,5 @@
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
+import java.util.function.Consumer;
 
 import javax.swing.ImageIcon;
@@ -118,5 +119,5 @@
     /**
      * Get the image resource associated with this MapImage object.
-     * This method blocks until the image has been loaded.
+     * This method blocks until the image resource has been loaded.
      * @return the image resource
      */
@@ -124,6 +125,6 @@
         if (imageResource == null) {
             try {
-                // load and wait for the image
-                loadImage().get();
+                // load and wait for the image resource
+                loadImageResource().get();
             } catch (ExecutionException | InterruptedException e) {
                 Logging.warn(e);
@@ -165,5 +166,5 @@
     }
 
-    private CompletableFuture<Void> loadImage() {
+    private CompletableFuture<Void> load(Consumer<? super ImageResource> action) {
         return new ImageProvider(name)
                 .setDirs(MapPaintStyles.getIconSourceDirs(source))
@@ -172,24 +173,48 @@
                 .setInArchiveDir(source.getZipEntryDirName())
                 .setOptional(true)
-                .getResourceAsync(result -> {
-                    synchronized (this) {
-                        imageResource = result;
-                        if (result == null) {
-                            source.logWarning(tr("Failed to locate image ''{0}''", name));
-                            ImageIcon noIcon = MapPaintStyles.getNoIconIcon(source);
-                            img = noIcon == null ? null : noIcon.getImage();
-                        } else {
-                            img = rescale(result.getImageIcon(new Dimension(width, height)).getImage());
-                        }
-                        if (temporary) {
-                            disabledImgCache = null;
-                            MapView mapView = MainApplication.getMap().mapView;
-                            mapView.preferenceChanged(null); // otherwise repaint is ignored, because layer hasn't changed
-                            mapView.repaint();
-                        }
-                        temporary = false;
-                    }
+                .getResourceAsync(action);
+    }
+
+    /**
+     * Loads image resource and actual rescaled image.
+     * @return the future of the requested image
+     * @see #loadImageResource
+     */
+    private CompletableFuture<Void> loadImage() {
+        return load(result -> {
+            synchronized (this) {
+                imageResource = result;
+                if (result == null) {
+                    source.logWarning(tr("Failed to locate image ''{0}''", name));
+                    ImageIcon noIcon = MapPaintStyles.getNoIconIcon(source);
+                    img = noIcon == null ? null : noIcon.getImage();
+                } else {
+                    img = rescale(result.getImageIcon(new Dimension(width, height)).getImage());
                 }
-        );
+                if (temporary) {
+                    disabledImgCache = null;
+                    MapView mapView = MainApplication.getMap().mapView;
+                    mapView.preferenceChanged(null); // otherwise repaint is ignored, because layer hasn't changed
+                    mapView.repaint();
+                }
+                temporary = false;
+            }
+        });
+    }
+
+    /**
+     * Loads image resource only.
+     * @return the future of the requested image resource
+     * @see #loadImage
+     */
+    private CompletableFuture<Void> loadImageResource() {
+        return load(result -> {
+            synchronized (this) {
+                imageResource = result;
+                if (result == null) {
+                    source.logWarning(tr("Failed to locate image ''{0}''", name));
+                }
+            }
+        });
     }
 
