Index: /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPlugin.java
===================================================================
--- /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPlugin.java	(revision 24571)
+++ /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPlugin.java	(revision 24572)
@@ -29,5 +29,4 @@
 import org.openstreetmap.josm.plugins.imagery.wms.WMSAdapter;
 import org.openstreetmap.josm.plugins.imagery.wms.WMSLayer;
-import org.openstreetmap.josm.plugins.imagery.wms.WMSRemoteHandler;
 import org.openstreetmap.josm.plugins.imagery.wms.io.WMSLayerExporter;
 import org.openstreetmap.josm.plugins.imagery.wms.io.WMSLayerImporter;
@@ -124,5 +123,5 @@
                     // replace command and class when you copy this to some other plug-in
                     // for compatibility with old remotecontrol add leading "/"
-                    method.invoke(plugin, "/" + WMSRemoteHandler.command, WMSRemoteHandler.class);
+                    method.invoke(plugin, "/" + ImageryRemoteHandler.command, ImageryRemoteHandler.class);
                     remoteControlInitialized = true;
                 }
Index: /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferenceEditor.java
===================================================================
--- /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferenceEditor.java	(revision 24571)
+++ /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferenceEditor.java	(revision 24572)
@@ -57,4 +57,6 @@
     private JButton btnFadeColor;
     private JSlider fadeAmount = new JSlider(0, 100);
+    private JCheckBox remoteCheckBox;
+    boolean allowRemoteControl = true;
 
     // WMS Settings
@@ -63,6 +65,4 @@
     JSpinner spinNorth;
     JSpinner spinSimConn;
-    JCheckBox remoteCheckBox;
-    boolean allowRemoteControl = true;
     WMSAdapter wmsAdapter = ImageryPlugin.wmsAdapter;
     ImageryPlugin plugin = ImageryPlugin.instance;
@@ -226,6 +226,10 @@
         p.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
         p.add(this.fadeAmount, GBC.eol().fill(GBC.HORIZONTAL));
-
         this.fadeAmount.setValue(ImageryPreferences.PROP_FADE_AMOUNT.get());
+
+        allowRemoteControl = ImageryPreferences.PROP_REMOTE_CONTROL.get();
+        remoteCheckBox = new JCheckBox(tr("Allow remote control (reqires remotecontrol plugin)"), allowRemoteControl);
+        p.add(remoteCheckBox,GBC.eol().fill(GBC.HORIZONTAL));
+
         return p;
     }
@@ -270,10 +274,4 @@
         p.add(overlapPanelSimConn, GBC.eol().fill(GBC.HORIZONTAL));
 
-        allowRemoteControl = Main.pref.getBoolean("wmsplugin.remotecontrol", true);
-        remoteCheckBox = new JCheckBox(tr("Allow remote control (reqires remotecontrol plugin)"), allowRemoteControl);
-        JPanel remotePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
-        remotePanel.add(remoteCheckBox);
-
-        p.add(remotePanel,GBC.eol().fill(GBC.HORIZONTAL));
         return p;
     }
@@ -314,5 +312,5 @@
         p.add(lbl,GBC.std());
         p.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 0));
-        p.add(section,GBC.eol().insets(20,5,0,5));
+        p.add(section,GBC.eol().insets(20,5,0,10));
     }
 
@@ -353,5 +351,4 @@
         Main.pref.put("wmsplugin.browser", browser.getEditor().getItem().toString());
 
-        Main.pref.put("wmsplugin.remotecontrol", String.valueOf(allowRemoteControl));
 
         TMSPreferences.PROP_DEFAULT_AUTOZOOM.put(this.autozoomActive.isSelected());
@@ -360,4 +357,5 @@
         TMSPreferences.setMinZoomLvl((Integer)this.minZoomLvl.getValue());
 
+        ImageryPreferences.PROP_REMOTE_CONTROL.put(allowRemoteControl);
         ImageryPreferences.PROP_FADE_AMOUNT.put(this.fadeAmount.getValue());
         ImageryPreferences.setFadeColor(this.colFadeColor);
Index: /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferences.java
===================================================================
--- /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferences.java	(revision 24571)
+++ /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferences.java	(revision 24572)
@@ -4,8 +4,10 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.preferences.BooleanProperty;
 import org.openstreetmap.josm.data.preferences.IntegerProperty;
 
 public class ImageryPreferences {
 
+    public static final BooleanProperty PROP_REMOTE_CONTROL = new BooleanProperty("imagery.remotecontrol", true);
     public static final IntegerProperty PROP_FADE_AMOUNT = new IntegerProperty("imagery.fade_amount", 0);
 
Index: /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryRemoteHandler.java
===================================================================
--- /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryRemoteHandler.java	(revision 24572)
+++ /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryRemoteHandler.java	(revision 24572)
@@ -0,0 +1,108 @@
+package org.openstreetmap.josm.plugins.imagery;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.HashMap;
+import java.util.StringTokenizer;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.remotecontrol.PermissionPrefWithDefault;
+import org.openstreetmap.josm.plugins.remotecontrol.RequestHandler;
+import org.openstreetmap.josm.plugins.remotecontrol.RequestHandlerErrorException;
+
+public class ImageryRemoteHandler extends RequestHandler {
+
+    public static final String command = "imagery";
+
+    @Override
+    public String getPermissionMessage() {
+        return tr("Remote Control has been asked to load an imagery layer from the following URL:") +
+        "<br>" + args.get("url");
+    }
+
+    @Override
+    public PermissionPrefWithDefault getPermissionPref()
+    {
+        return new PermissionPrefWithDefault(
+                "imagery.remotecontrol",
+                true,
+        "RemoteControl: Imagery forbidden by preferences");
+    }
+
+    @Override
+    protected String[] getMandatoryParams()
+    {
+        return new String[] { "url" };
+    }
+
+    @Override
+    protected void handleRequest() throws RequestHandlerErrorException {
+        if (Main.map == null) //Avoid exception when creating ImageryLayer with null MapFrame
+            throw new RequestHandlerErrorException();
+        String url = args.get("url");
+        String title = args.get("title");
+        if((title == null) || (title.length() == 0))
+        {
+            title = tr("Remote imagery");
+        }
+        String cookies = args.get("cookies");
+        ImageryLayer imgLayer = ImageryLayer.create(new ImageryInfo(title, url, cookies));
+        Main.main.addLayer(imgLayer);
+
+    }
+
+    @Override
+    public void parseArgs() {
+        StringTokenizer st = new StringTokenizer(request, "&?");
+        HashMap<String, String> args = new HashMap<String, String>();
+        // skip first element which is the command
+        if(st.hasMoreTokens()) st.nextToken();
+        while (st.hasMoreTokens()) {
+            String param = st.nextToken();
+            int eq = param.indexOf("=");
+            if (eq > -1)
+            {
+                String key = param.substring(0, eq);
+                /* "url=" terminates normal parameters
+                 * and will be handled separately
+                 */
+                if("url".equals(key)) break;
+
+                String value = param.substring(eq + 1);
+                // urldecode all normal values
+                try {
+                    value = URLDecoder.decode(value, "UTF-8");
+                } catch (UnsupportedEncodingException e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+                args.put(key,
+                        value);
+            }
+        }
+        // url as second or later parameter
+        int urlpos = request.indexOf("&url=");
+        // url as first (and only) parameter
+        if(urlpos < 0) urlpos = request.indexOf("?url=");
+        // url found?
+        if(urlpos >= 0) {
+            // URL value
+            String value = request.substring(urlpos + 5);
+            // allow skipping URL decoding with urldecode=false
+            String urldecode = args.get("urldecode");
+            if((urldecode == null) || (Boolean.valueOf(urldecode) == true))
+            {
+                try {
+                    value = URLDecoder.decode(value, "UTF-8");
+                } catch (UnsupportedEncodingException e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+            args.put("url", value);
+        }
+        this.args = args;
+    }
+}
Index: plications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/wms/WMSRemoteHandler.java
===================================================================
--- /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/wms/WMSRemoteHandler.java	(revision 24571)
+++ 	(revision )
@@ -1,107 +1,0 @@
-package org.openstreetmap.josm.plugins.imagery.wms;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.HashMap;
-import java.util.StringTokenizer;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.plugins.imagery.ImageryInfo;
-import org.openstreetmap.josm.plugins.remotecontrol.PermissionPrefWithDefault;
-import org.openstreetmap.josm.plugins.remotecontrol.RequestHandler;
-import org.openstreetmap.josm.plugins.remotecontrol.RequestHandlerErrorException;
-
-public class WMSRemoteHandler extends RequestHandler {
-
-    public static final String command = "wms";
-
-    @Override
-    public String getPermissionMessage() {
-        return tr("Remote Control has been asked to load a WMS layer from the following URL:") +
-        "<br>" + args.get("url");
-    }
-
-    @Override
-    public PermissionPrefWithDefault getPermissionPref()
-    {
-        return new PermissionPrefWithDefault(
-                "wmsplugin.remotecontrol",
-                true,
-        "RemoteControl: WMS forbidden by preferences");
-    }
-
-    @Override
-    protected String[] getMandatoryParams()
-    {
-        return new String[] { "url" };
-    }
-
-    @Override
-    protected void handleRequest() throws RequestHandlerErrorException {
-        String url = args.get("url");
-        String title = args.get("title");
-        if((title == null) || (title.length() == 0))
-        {
-            title = tr("Remote WMS");
-        }
-        String cookies = args.get("cookies");
-        WMSLayer wmsLayer = new WMSLayer(new ImageryInfo(title, url, cookies));
-        Main.main.addLayer(wmsLayer);
-
-    }
-
-    @Override
-    public void parseArgs() {
-        StringTokenizer st = new StringTokenizer(request, "&?");
-        HashMap<String, String> args = new HashMap<String, String>();
-        // skip first element which is the command
-        if(st.hasMoreTokens()) st.nextToken();
-        while (st.hasMoreTokens()) {
-            String param = st.nextToken();
-            int eq = param.indexOf("=");
-            if (eq > -1)
-            {
-                String key = param.substring(0, eq);
-                /* "url=" terminates normal parameters
-                 * and will be handled separately
-                 */
-                if("url".equals(key)) break;
-
-                String value = param.substring(eq + 1);
-                // urldecode all normal values
-                try {
-                    value = URLDecoder.decode(value, "UTF-8");
-                } catch (UnsupportedEncodingException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
-                }
-                args.put(key,
-                        value);
-            }
-        }
-        // url as second or later parameter
-        int urlpos = request.indexOf("&url=");
-        // url as first (and only) parameter
-        if(urlpos < 0) urlpos = request.indexOf("?url=");
-        // url found?
-        if(urlpos >= 0) {
-            // URL value
-            String value = request.substring(urlpos + 5);
-            // allow skipping URL decoding with urldecode=false
-            String urldecode = args.get("urldecode");
-            if((urldecode == null) || (Boolean.valueOf(urldecode) == true))
-            {
-                try {
-                    value = URLDecoder.decode(value, "UTF-8");
-                } catch (UnsupportedEncodingException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
-                }
-            }
-            args.put("url", value);
-        }
-        this.args = args;
-    }
-}
