Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java	(revision 17143)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java	(revision 17144)
@@ -190,5 +190,9 @@
                     img = noIcon == null ? null : noIcon.getImage();
                 } else {
-                    img = rescale(result.getImageIcon(new Dimension(width, height)).getImage());
+                    img = result.getImageIcon(new Dimension(width, height)).getImage();
+                    if (img != null && mustRescale(img)) {
+                        // Scale down large images to 16x16 pixels if no size is explicitly specified
+                        img = result.getImageIconBounded(ImageProvider.ImageSizes.MAP.getImageDimension()).getImage();
+                    }
                 }
                 if (temporary) {
@@ -301,19 +305,4 @@
     }
 
-    /**
-     * Rescale excessively large images.
-     * @param image the unscaled image
-     * @return The scaled down version to 16x16 pixels if the image height and width exceeds 48 pixels and no size has been explicitly specified
-     */
-    private Image rescale(Image image) {
-        if (image == null) return null;
-        // Scale down large (.svg) images to 16x16 pixels if no size is explicitly specified
-        if (mustRescale(image)) {
-            return ImageProvider.createBoundedImage(image, 16);
-        } else {
-            return image;
-        }
-    }
-
     private boolean mustRescale(Image image) {
         return autoRescale && width == -1 && image.getWidth(null) > MAX_SIZE
Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 17143)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 17144)
@@ -661,5 +661,5 @@
         }
         if (virtualMaxWidth != -1 || virtualMaxHeight != -1)
-            return ir.getImageIcon(new Dimension(virtualMaxWidth, virtualMaxHeight), multiResolution, ImageResizeMode.BOUNDED);
+            return ir.getImageIcon(new Dimension(virtualMaxWidth, virtualMaxHeight), multiResolution, null);
         else
             return ir.getImageIcon(new Dimension(virtualWidth, virtualHeight), multiResolution, ImageResizeMode.AUTO);
@@ -1489,7 +1489,4 @@
             Logging.error("createImageFromSvg: {0} {1} sourceWidth={2} sourceHeight={3}", svg.getXMLBase(), dim, sourceWidth, sourceHeight);
             return null;
-        }
-        if (resizeMode == ImageResizeMode.BOUNDED) {
-            resizeMode = ImageResizeMode.BOUNDED_UPSCALE;
         }
         return resizeMode.createBufferedImage(dim, new Dimension((int) sourceWidth, (int) sourceHeight), g -> {
Index: trunk/src/org/openstreetmap/josm/tools/ImageResizeMode.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageResizeMode.java	(revision 17143)
+++ trunk/src/org/openstreetmap/josm/tools/ImageResizeMode.java	(revision 17144)
@@ -14,4 +14,7 @@
 enum ImageResizeMode {
 
+    /**
+     * Calculate proportional dimensions that best fit into the target width and height, retain aspect ratio
+     */
     AUTO {
         @Override
@@ -25,38 +28,29 @@
             } else if (dim.height == -1) {
                 return new Dimension(dim.width, Math.max(1, icon.height * dim.width / icon.width));
+            } else if (icon.getWidth() / dim.getWidth() > icon.getHeight() / dim.getHeight()) {
+                return computeDimension(new Dimension(dim.width, -1), icon);
             } else {
-                return dim;
+                return computeDimension(new Dimension(-1, dim.height), icon);
             }
         }
     },
 
+    /**
+     * Calculate dimensions for the largest image that fit within the bounding box, retain aspect ratio
+     */
     BOUNDED {
-        @Override
-        Dimension computeDimension(Dimension dim, Dimension icon) {
-            final int maxWidth = Math.min(dim.width, icon.width);
-            final int maxHeight = Math.min(dim.height, icon.height);
-            return BOUNDED_UPSCALE.computeDimension(new Dimension(maxWidth, maxHeight), icon);
-        }
-    },
-
-    BOUNDED_UPSCALE {
         @Override
         Dimension computeDimension(Dimension dim, Dimension icon) {
             CheckParameterUtil.ensureThat((dim.width > 0 || dim.width == -1) && (dim.height > 0 || dim.height == -1),
                     () -> dim + " is invalid");
-            final int maxWidth = dim.width;
-            final int maxHeight = dim.height;
-            final Dimension spec;
-            if (maxWidth == -1 || maxHeight == -1) {
-                spec = dim;
-            } else if (icon.getWidth() / maxWidth > icon.getHeight() / maxHeight) {
-                spec = new Dimension(maxWidth, -1);
-            } else {
-                spec = new Dimension(-1, maxHeight);
-            }
-            return AUTO.computeDimension(spec, icon);
+            final int maxWidth = Math.min(dim.width, icon.width);
+            final int maxHeight = Math.min(dim.height, icon.height);
+            return AUTO.computeDimension(new Dimension(maxWidth, maxHeight), icon);
         }
     },
 
+    /**
+     * Position an appropriately scaled image within the bounding box, retain aspect ratio
+     */
     PADDED {
         @Override
Index: trunk/src/org/openstreetmap/josm/tools/ImageResource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageResource.java	(revision 17143)
+++ trunk/src/org/openstreetmap/josm/tools/ImageResource.java	(revision 17144)
@@ -102,9 +102,9 @@
     public void attachImageIcon(AbstractAction a) {
         Dimension iconDimension = ImageProvider.ImageSizes.SMALLICON.getImageDimension();
-        ImageIcon icon = getImageIconBounded(iconDimension);
+        ImageIcon icon = getImageIcon(iconDimension);
         a.putValue(Action.SMALL_ICON, icon);
 
         iconDimension = ImageProvider.ImageSizes.LARGEICON.getImageDimension();
-        icon = getImageIconBounded(iconDimension);
+        icon = getImageIcon(iconDimension);
         a.putValue(Action.LARGE_ICON_KEY, icon);
     }
@@ -141,5 +141,5 @@
      */
     public ImageIcon getImageIcon(Dimension dim) {
-        return getImageIcon(dim, true, ImageResizeMode.AUTO);
+        return getImageIcon(dim, true, null);
     }
 
@@ -175,4 +175,10 @@
                 () -> dim + " is invalid");
 
+        if (resizeMode == null && svg != null) {
+            // upscale SVG icons
+            resizeMode = ImageResizeMode.AUTO;
+        } else if (resizeMode == null) {
+            resizeMode = ImageResizeMode.BOUNDED;
+        }
         final int cacheKey = resizeMode.cacheKey(dim);
         BufferedImage img = imgCache.get(cacheKey);
