diff --git a/data/maps.xsd b/data/maps.xsd
index 59fa397..53fb356 100644
--- a/data/maps.xsd
+++ b/data/maps.xsd
@@ -623,6 +623,8 @@
 						<xs:element name="terms-of-use-url" minOccurs="0" maxOccurs="1" type="xs:string" />
 						<!-- The ISO 3166 country code -->
 						<xs:element name="country-code" minOccurs="0" maxOccurs="1" type="tns:iso3166" />
+                                                <!-- A base64-encoded image that is displayed as menu/toolbar icon -->
+						<xs:element name="icon-base64" minOccurs="0" maxOccurs="1" type="xs:string" />
 					</xs:all>
 				</xs:complexType>
 			</xs:element>
diff --git a/src/org/openstreetmap/gui/jmapviewer/AttributionSupport.java b/src/org/openstreetmap/gui/jmapviewer/AttributionSupport.java
index cb7c034..cc26148 100644
--- a/src/org/openstreetmap/gui/jmapviewer/AttributionSupport.java
+++ b/src/org/openstreetmap/gui/jmapviewer/AttributionSupport.java
@@ -24,6 +24,7 @@ public class AttributionSupport {
     private Image attrImage;
     private String attrTermsText;
     private String attrTermsUrl;
+    private static final int MAX_IMAGE_SIZE = 80;
     public static final Font ATTR_FONT = new Font("Arial", Font.PLAIN, 10);
     public static final Font ATTR_LINK_FONT;
     
@@ -42,6 +43,13 @@ public class AttributionSupport {
         boolean requireAttr = source.requiresAttribution();
         if (requireAttr) {
             attrImage = source.getAttributionImage();
+            if(attrImage!=null)
+                System.out.println(attrImage.getWidth(null));
+            if (attrImage != null
+                    && (attrImage.getWidth(null) > MAX_IMAGE_SIZE
+                    || attrImage.getHeight(null) > MAX_IMAGE_SIZE)) {
+                attrImage = attrImage.getScaledInstance(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE, Image.SCALE_SMOOTH);
+            }
             attrTermsText = source.getTermsOfUseText();
             attrTermsUrl = source.getTermsOfUseURL();
             if (attrTermsUrl != null && attrTermsText == null) {
diff --git a/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java b/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
index 95cccca..7d40cf6 100644
--- a/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
+++ b/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
@@ -3,24 +3,52 @@ package org.openstreetmap.josm.actions;
 
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.Image;
 import java.awt.event.ActionEvent;
-
+import javax.swing.Action;
+import javax.swing.ImageIcon;
 import javax.swing.JOptionPane;
-
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
 import org.openstreetmap.josm.gui.layer.ImageryLayer;
+import sun.misc.BASE64Decoder;
 
 public class AddImageryLayerAction extends JosmAction implements AdaptableAction {
 
+    private static final int MAX_ICON_SIZE = 24;
     private final ImageryInfo info;
 
     public AddImageryLayerAction(ImageryInfo info) {
-        super(info.getMenuName(), /* ICON */"imagery_menu", tr("Add imagery layer {0}",info.getName()), null, false, false);
+        super(info.getMenuName(),
+                /* ICON */ "imagery_menu",
+                tr("Add imagery layer {0}", info.getName()),
+                null, false, false);
         putValue("toolbar", "imagery_" + info.getToolbarName());
         this.info = info;
         installAdapters();
+
+        /* add toolbar icon from attribution image */
+        try {
+            ImageIcon i = null;
+            if (info.getIconBase64() != null) {
+                i = new ImageIcon(new BASE64Decoder().decodeBuffer(info.getIconBase64()));
+                if (i.getIconHeight() > MAX_ICON_SIZE || i.getIconWidth() > MAX_ICON_SIZE) {
+                    i = new ImageIcon(i.getImage().getScaledInstance(MAX_ICON_SIZE, MAX_ICON_SIZE, Image.SCALE_SMOOTH));
+                }
+                putValue(Action.SMALL_ICON, i);
+            } else if (info.getAttributionImage() != null) {
+                i = new ImageIcon(info.getAttributionImage());
+            }
+            if (i != null) {
+                if (i.getIconHeight() > MAX_ICON_SIZE || i.getIconWidth() > MAX_ICON_SIZE) {
+                    i = new ImageIcon(i.getImage().getScaledInstance(MAX_ICON_SIZE, MAX_ICON_SIZE, Image.SCALE_SMOOTH));
+                }
+                putValue(Action.SMALL_ICON, i);
+            }
+        } catch (Exception ex) {
+            throw new RuntimeException(ex.getMessage(), ex);
+        }
     }
 
     @Override
@@ -52,4 +80,4 @@ public class AddImageryLayerAction extends JosmAction implements AdaptableAction
             setEnabled(false);
         }
     }
-}
+}
\ No newline at end of file
diff --git a/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java b/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
index 955d94e..59170ab 100644
--- a/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
+++ b/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
@@ -84,6 +84,7 @@ public class ImageryInfo implements Comparable<ImageryInfo>, Attributed {
     private String termsOfUseText;
     private String termsOfUseURL;
     private String countryCode = "";
+    private String iconBase64;
 
     /** auxiliary class to save an ImageryInfo object in the preferences */
     public static class ImageryPreferenceEntry {
@@ -105,6 +106,7 @@ public class ImageryInfo implements Comparable<ImageryInfo>, Attributed {
         @pref String bounds;
         @pref String shapes;
         @pref String projections;
+        @pref String iconBase64;
 
         public ImageryPreferenceEntry() {
         }
@@ -125,6 +127,7 @@ public class ImageryInfo implements Comparable<ImageryInfo>, Attributed {
             max_zoom = i.defaultMaxZoom;
             min_zoom = i.defaultMinZoom;
             cookies = i.cookies;
+            iconBase64 = i.iconBase64;
             if (i.bounds != null) {
                 bounds = i.bounds.encodeAsString(",");
                 String shapesString = "";
@@ -218,6 +221,7 @@ public class ImageryInfo implements Comparable<ImageryInfo>, Attributed {
         termsOfUseText = e.terms_of_use_text;
         termsOfUseURL = e.terms_of_use_url;
         countryCode = e.country_code;
+        iconBase64 = e.iconBase64;
     }
 
     public ImageryInfo(Collection<String> list) {
@@ -284,6 +288,7 @@ public class ImageryInfo implements Comparable<ImageryInfo>, Attributed {
         this.termsOfUseText = i.termsOfUseText;
         this.termsOfUseURL = i.termsOfUseURL;
         this.serverProjections = i.serverProjections;
+        this.iconBase64 = i.iconBase64;
     }
 
     @Override
@@ -514,6 +519,14 @@ public class ImageryInfo implements Comparable<ImageryInfo>, Attributed {
         this.countryCode = countryCode;
     }
 
+    public String getIconBase64() {
+        return iconBase64;
+    }
+
+    public void setIconBase64(String iconBase64) {
+        this.iconBase64 = iconBase64;
+    }
+
     /**
      * Get the projections supported by the server. Only relevant for
      * WMS-type ImageryInfo at the moment.
diff --git a/src/org/openstreetmap/josm/io/imagery/ImageryReader.java b/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
index acdec59..97e0a06 100644
--- a/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
+++ b/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
@@ -129,6 +129,7 @@ public class ImageryReader {
                         "terms-of-use-text",
                         "terms-of-use-url",
                         "country-code",
+                        "icon-base64",
                     }).contains(qName)) {
                         newState = State.ENTRY_ATTRIBUTE;
                     } else if (qName.equals("bounds")) {
@@ -259,6 +260,8 @@ public class ImageryReader {
                         entry.setTermsOfUseURL(accumulator.toString());
                     } else if (qName.equals("country-code")) {
                         entry.setCountryCode(accumulator.toString());
+                    } else if (qName.equals("icon-base64")) {
+                        entry.setIconBase64(accumulator.toString());
                     } else {
                     }
                     break;
