Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java	(revision 31321)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java	(revision 31322)
@@ -12,130 +12,130 @@
  */
 public class MapillaryImage extends MapillaryAbstractImage {
-    /** Unique identifier of the object */
-    private final String key;
-    /** Sequence of pictures containing this object */
-    private MapillarySequence sequence;
+	/** Unique identifier of the object */
+	private final String key;
+	/** Sequence of pictures containing this object */
+	private MapillarySequence sequence;
 
-    /** Epoch time when the image was taken. */
-    /** The user that made the image */
-    private String user;
-    /** Set of traffic signs in the image */
-    private List<String> signs;
-    private String location;
+	/** Epoch time when the image was taken. */
+	/** The user that made the image */
+	private String user;
+	/** Set of traffic signs in the image */
+	private List<String> signs;
+	private String location;
 
-    public String getLocation() {
-        return location;
-    }
+	public String getLocation() {
+		return location;
+	}
 
-    public void setLocation(String location) {
-        this.location = location;
-    }
+	public void setLocation(String location) {
+		this.location = location;
+	}
 
-    /**
-     * Main contructor of the class MapillaryImage
-     * 
-     * @param key
-     *            The unique identifier of the image.
-     * @param lat
-     *            The latitude where it is positioned.
-     * @param lon
-     *            The longitude where it is positioned.
-     * @param ca
-     *            The direction of the images in degrees, meaning 0 north.
-     */
-    public MapillaryImage(String key, double lat, double lon, double ca) {
-        super(lat, lon, ca);
-        this.key = key;
-        this.signs = new ArrayList<>();
-    }
+	/**
+	 * Main contructor of the class MapillaryImage
+	 * 
+	 * @param key
+	 *            The unique identifier of the image.
+	 * @param lat
+	 *            The latitude where it is positioned.
+	 * @param lon
+	 *            The longitude where it is positioned.
+	 * @param ca
+	 *            The direction of the images in degrees, meaning 0 north.
+	 */
+	public MapillaryImage(String key, double lat, double lon, double ca) {
+		super(lat, lon, ca);
+		this.key = key;
+		this.signs = new ArrayList<>();
+	}
 
-    /**
-     * Returns the unique identifier of the object.
-     * 
-     * @return A String containing the unique identifier of the object.
-     */
-    public String getKey() {
-        return this.key;
-    }
+	/**
+	 * Returns the unique identifier of the object.
+	 * 
+	 * @return A String containing the unique identifier of the object.
+	 */
+	public String getKey() {
+		return this.key;
+	}
 
-    /**
-     * Adds a new sign to the set of signs.
-     * 
-     * @param sign
-     */
-    public void addSign(String sign) {
-        signs.add(sign);
-    }
+	/**
+	 * Adds a new sign to the set of signs.
+	 * 
+	 * @param sign
+	 */
+	public void addSign(String sign) {
+		signs.add(sign);
+	}
 
-    public List<String> getSigns() {
-        return signs;
-    }
+	public List<String> getSigns() {
+		return signs;
+	}
 
-    public void setUser(String user) {
-        this.user = user;
-    }
+	public void setUser(String user) {
+		this.user = user;
+	}
 
-    public String getUser() {
-        return user;
-    }
+	public String getUser() {
+		return user;
+	}
 
-    /**
-     * Sets the MapillarySequence object which contains the MapillaryImage.
-     * 
-     * @param sequence
-     *            The MapillarySequence that contains the MapillaryImage.
-     */
-    public void setSequence(MapillarySequence sequence) {
-        this.sequence = sequence;
-    }
+	/**
+	 * Sets the MapillarySequence object which contains the MapillaryImage.
+	 * 
+	 * @param sequence
+	 *            The MapillarySequence that contains the MapillaryImage.
+	 */
+	public void setSequence(MapillarySequence sequence) {
+		this.sequence = sequence;
+	}
 
-    /**
-     * Returns the sequence which contains this image.
-     * 
-     * @return The MapillarySequence object that contains this MapillaryImage.
-     */
-    public MapillarySequence getSequence() {
-        return this.sequence;
-    }
+	/**
+	 * Returns the sequence which contains this image.
+	 * 
+	 * @return The MapillarySequence object that contains this MapillaryImage.
+	 */
+	public MapillarySequence getSequence() {
+		return this.sequence;
+	}
 
-    public String toString() {
-        return "Image[key=" + this.key + ";lat=" + this.latLon.lat() + ";lon="
-                + this.latLon.lon() + ";ca=" + this.ca + "]";
-    }
+	public String toString() {
+		return "Image[key=" + this.key + ";lat=" + this.latLon.lat() + ";lon="
+				+ this.latLon.lon() + ";ca=" + this.ca + "]";
+	}
 
-    /**
-     * If the MapillaryImage belongs to a MapillarySequence, returns the next
-     * MapillarySequence in it.
-     * 
-     * @return The following MapillaryImage, or null if there is none.
-     */
-    public MapillaryImage next() {
-        if (this.getSequence() == null)
-            return null;
-        return this.getSequence().next(this);
-    }
+	/**
+	 * If the MapillaryImage belongs to a MapillarySequence, returns the next
+	 * MapillarySequence in it.
+	 * 
+	 * @return The following MapillaryImage, or null if there is none.
+	 */
+	public MapillaryImage next() {
+		if (this.getSequence() == null)
+			return null;
+		return this.getSequence().next(this);
+	}
 
-    /**
-     * If the MapillaryImage belongs to a MapillarySequence, returns the
-     * previous MapillarySequence in it.
-     * 
-     * @return The previous MapillaryImage, or null if there is none.
-     */
-    public MapillaryImage previous() {
-        if (this.getSequence() == null)
-            return null;
-        return this.getSequence().previous(this);
-    }
+	/**
+	 * If the MapillaryImage belongs to a MapillarySequence, returns the
+	 * previous MapillarySequence in it.
+	 * 
+	 * @return The previous MapillaryImage, or null if there is none.
+	 */
+	public MapillaryImage previous() {
+		if (this.getSequence() == null)
+			return null;
+		return this.getSequence().previous(this);
+	}
 
-    @Override
-    public boolean equals(Object object) {
-        if (object instanceof MapillaryImage)
-            return this.key.equals(((MapillaryImage) object).getKey());
-        return false;
-    }
+	@Override
+	public boolean equals(Object object) {
+		if (object instanceof MapillaryImage)
+			return this.key.equals(((MapillaryImage) object).getKey());
+		return false;
+	}
 
-    @Override
-    public int hashCode() {
-        return this.key.hashCode();
-    }
+	@Override
+	public int hashCode() {
+		return this.key.hashCode();
+	}
 }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31321)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31322)
@@ -255,100 +255,94 @@
 	 */
 	@Override
-	public void paint(Graphics2D g, MapView mv, Bounds box) {
-		synchronized (this) {
-			if (Main.map.mapView.getActiveLayer() == this) {
-				Rectangle b = mv.getBounds();
-				// on some platforms viewport bounds seem to be offset from the
-				// left,
-				// over-grow it just to be sure
-				b.grow(100, 100);
-				Area a = new Area(b);
-				// now successively subtract downloaded areas
-				for (Bounds bounds : this.bounds) {
-					Point p1 = mv.getPoint(bounds.getMin());
-					Point p2 = mv.getPoint(bounds.getMax());
-					Rectangle r = new Rectangle(Math.min(p1.x, p2.x), Math.min(
-							p1.y, p2.y), Math.abs(p2.x - p1.x), Math.abs(p2.y
-							- p1.y));
-					a.subtract(new Area(r));
+	public synchronized void paint(Graphics2D g, MapView mv, Bounds box) {
+		if (Main.map.mapView.getActiveLayer() == this) {
+			Rectangle b = mv.getBounds();
+			// on some platforms viewport bounds seem to be offset from the
+			// left,
+			// over-grow it just to be sure
+			b.grow(100, 100);
+			Area a = new Area(b);
+			// now successively subtract downloaded areas
+			for (Bounds bounds : this.bounds) {
+				Point p1 = mv.getPoint(bounds.getMin());
+				Point p2 = mv.getPoint(bounds.getMax());
+				Rectangle r = new Rectangle(Math.min(p1.x, p2.x), Math.min(
+						p1.y, p2.y), Math.abs(p2.x - p1.x), Math.abs(p2.y
+						- p1.y));
+				a.subtract(new Area(r));
+			}
+			// paint remainder
+			g.setPaint(hatched);
+			g.fill(a);
+		}
+
+		// Draw colored lines
+		MapillaryLayer.BLUE = null;
+		MapillaryLayer.RED = null;
+		MapillaryToggleDialog.getInstance().blueButton.setEnabled(false);
+		MapillaryToggleDialog.getInstance().redButton.setEnabled(false);
+
+		// Sets blue and red lines and enables/disables the buttons
+		if (data.getSelectedImage() != null) {
+			MapillaryImage[] closestImages = getClosestImagesFromDifferentSequences();
+			Point selected = mv.getPoint(data.getSelectedImage().getLatLon());
+			if (closestImages[0] != null) {
+				MapillaryLayer.BLUE = closestImages[0];
+				g.setColor(Color.BLUE);
+				g.drawLine(mv.getPoint(closestImages[0].getLatLon()).x,
+						mv.getPoint(closestImages[0].getLatLon()).y,
+						selected.x, selected.y);
+				MapillaryToggleDialog.getInstance().blueButton.setEnabled(true);
+			}
+			if (closestImages[1] != null) {
+				MapillaryLayer.RED = closestImages[1];
+				g.setColor(Color.RED);
+				g.drawLine(mv.getPoint(closestImages[1].getLatLon()).x,
+						mv.getPoint(closestImages[1].getLatLon()).y,
+						selected.x, selected.y);
+				MapillaryToggleDialog.getInstance().redButton.setEnabled(true);
+			}
+		}
+		g.setColor(Color.WHITE);
+		for (MapillaryAbstractImage imageAbs : data.getImages()) {
+			if (!imageAbs.isVisible())
+				continue;
+			Point p = mv.getPoint(imageAbs.getLatLon());
+			if (imageAbs instanceof MapillaryImage) {
+				MapillaryImage image = (MapillaryImage) imageAbs;
+				Point nextp = null;
+				// Draw sequence line
+				if (image.getSequence() != null) {
+					MapillaryImage tempImage = image;
+					while (tempImage.next() != null) {
+						tempImage = tempImage.next();
+						if (tempImage.isVisible()) {
+							nextp = mv.getPoint(tempImage.getLatLon());
+							break;
+						}
+					}
+					if (nextp != null)
+						g.drawLine(p.x, p.y, nextp.x, nextp.y);
 				}
-				// paint remainder
-				g.setPaint(hatched);
-				g.fill(a);
-			}
-
-			// Draw colored lines
-			MapillaryLayer.BLUE = null;
-			MapillaryLayer.RED = null;
-			MapillaryToggleDialog.getInstance().blueButton.setEnabled(false);
-			MapillaryToggleDialog.getInstance().redButton.setEnabled(false);
-
-			// Sets blue and red lines and enables/disables the buttons
-			if (data.getSelectedImage() != null) {
-				MapillaryImage[] closestImages = getClosestImagesFromDifferentSequences();
-				Point selected = mv.getPoint(data.getSelectedImage()
-						.getLatLon());
-				if (closestImages[0] != null) {
-					MapillaryLayer.BLUE = closestImages[0];
-					g.setColor(Color.BLUE);
-					g.drawLine(mv.getPoint(closestImages[0].getLatLon()).x,
-							mv.getPoint(closestImages[0].getLatLon()).y,
-							selected.x, selected.y);
-					MapillaryToggleDialog.getInstance().blueButton
-							.setEnabled(true);
+
+				ImageIcon icon;
+				if (!data.getMultiSelectedImages().contains(image))
+					icon = MapillaryPlugin.MAP_ICON;
+				else
+					icon = MapillaryPlugin.MAP_ICON_SELECTED;
+				draw(g, image, icon, p);
+				if (!image.getSigns().isEmpty()) {
+					g.drawImage(MapillaryPlugin.MAP_SIGN.getImage(),
+							p.x + icon.getIconWidth() / 2,
+							p.y - icon.getIconHeight() / 2, Main.map.mapView);
 				}
-				if (closestImages[1] != null) {
-					MapillaryLayer.RED = closestImages[1];
-					g.setColor(Color.RED);
-					g.drawLine(mv.getPoint(closestImages[1].getLatLon()).x,
-							mv.getPoint(closestImages[1].getLatLon()).y,
-							selected.x, selected.y);
-					MapillaryToggleDialog.getInstance().redButton
-							.setEnabled(true);
-				}
-			}
-			g.setColor(Color.WHITE);
-			for (MapillaryAbstractImage imageAbs : data.getImages()) {
-				if (!imageAbs.isVisible())
-					continue;
-				Point p = mv.getPoint(imageAbs.getLatLon());
-				if (imageAbs instanceof MapillaryImage) {
-					MapillaryImage image = (MapillaryImage) imageAbs;
-					Point nextp = null;
-					// Draw sequence line
-					if (image.getSequence() != null) {
-						MapillaryImage tempImage = image;
-						while (tempImage.next() != null) {
-							tempImage = tempImage.next();
-							if (tempImage.isVisible()) {
-								nextp = mv.getPoint(tempImage.getLatLon());
-								break;
-							}
-						}
-						if (nextp != null)
-							g.drawLine(p.x, p.y, nextp.x, nextp.y);
-					}
-
-					ImageIcon icon;
-					if (!data.getMultiSelectedImages().contains(image))
-						icon = MapillaryPlugin.MAP_ICON;
-					else
-						icon = MapillaryPlugin.MAP_ICON_SELECTED;
-					draw(g, image, icon, p);
-					if (!image.getSigns().isEmpty()) {
-						g.drawImage(MapillaryPlugin.MAP_SIGN.getImage(), p.x
-								+ icon.getIconWidth() / 2,
-								p.y - icon.getIconHeight() / 2,
-								Main.map.mapView);
-					}
-				} else if (imageAbs instanceof MapillaryImportedImage) {
-					MapillaryImportedImage image = (MapillaryImportedImage) imageAbs;
-					ImageIcon icon;
-					if (!data.getMultiSelectedImages().contains(image))
-						icon = MapillaryPlugin.MAP_ICON_IMPORTED;
-					else
-						icon = MapillaryPlugin.MAP_ICON_SELECTED;
-					draw(g, image, icon, p);
-				}
+			} else if (imageAbs instanceof MapillaryImportedImage) {
+				MapillaryImportedImage image = (MapillaryImportedImage) imageAbs;
+				ImageIcon icon;
+				if (!data.getMultiSelectedImages().contains(image))
+					icon = MapillaryPlugin.MAP_ICON_IMPORTED;
+				else
+					icon = MapillaryPlugin.MAP_ICON_SELECTED;
+				draw(g, image, icon, p);
 			}
 		}
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java	(revision 31321)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java	(revision 31322)
@@ -7,4 +7,6 @@
 
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
 
 /**
@@ -16,57 +18,58 @@
 public class MapillaryDownloader {
 
-    public final static String BASE_URL = "https://a.mapillary.com/v2/";
-    public final static String CLIENT_ID = "NzNRM2otQkR2SHJzaXJmNmdQWVQ0dzo1YTA2NmNlODhlNWMwOTBm";
+	public final static String BASE_URL = "https://a.mapillary.com/v2/";
+	public final static String CLIENT_ID = "NzNRM2otQkR2SHJzaXJmNmdQWVQ0dzo1YTA2NmNlODhlNWMwOTBm";
+	public final static Executor EXECUTOR = Executors.newSingleThreadExecutor();
 
-    private String[] parameters = { "lat", "lon", "distance", "limit",
-            "min_lat", "min_lon", "max_lat", "max_lon" };
+	private String[] parameters = { "lat", "lon", "distance", "limit",
+			"min_lat", "min_lon", "max_lat", "max_lon" };
 
-    public MapillaryDownloader() {
-    }
+	public MapillaryDownloader() {
+	}
 
-    /**
-     * Gets all the images in a square. It downloads all the images of all the
-     * sequences that pass through the given rectangle.
-     * 
-     * @param minLatLon
-     *            The minimum latitude and longitude of the rectangle.
-     * @param maxLatLon
-     *            The maximum latitude and longitude of the rectangle
-     */
-    public void getImages(LatLon minLatLon, LatLon maxLatLon) {
-        String url1 = BASE_URL;
-        String url2 = BASE_URL;
-        String url3 = BASE_URL;
-        url1 += "search/im/";
-        url2 += "search/s/";
-        url3 += "search/im/or";
-        ConcurrentHashMap<String, Double> hash = new ConcurrentHashMap<>();
-        hash.put("min_lat", minLatLon.lat());
-        hash.put("min_lon", minLatLon.lon());
-        hash.put("max_lat", maxLatLon.lat());
-        hash.put("max_lon", maxLatLon.lon());
-        url1 += buildParameters(hash);
-        url2 += buildParameters(hash);
-        url3 += buildParameters(hash);
+	/**
+	 * Gets all the images in a square. It downloads all the images of all the
+	 * sequences that pass through the given rectangle.
+	 * 
+	 * @param minLatLon
+	 *            The minimum latitude and longitude of the rectangle.
+	 * @param maxLatLon
+	 *            The maximum latitude and longitude of the rectangle
+	 */
+	public void getImages(LatLon minLatLon, LatLon maxLatLon) {
+		String url1 = BASE_URL;
+		String url2 = BASE_URL;
+		String url3 = BASE_URL;
+		url1 += "search/im/";
+		url2 += "search/s/";
+		url3 += "search/im/or";
+		ConcurrentHashMap<String, Double> hash = new ConcurrentHashMap<>();
+		hash.put("min_lat", minLatLon.lat());
+		hash.put("min_lon", minLatLon.lon());
+		hash.put("max_lat", maxLatLon.lat());
+		hash.put("max_lon", maxLatLon.lon());
+		url1 += buildParameters(hash);
+		url2 += buildParameters(hash);
+		url3 += buildParameters(hash);
 
-        try {
-            Main.info("GET " + url2 + " (Mapillary plugin)");
-            Main.worker.submit(new MapillarySquareDownloadManagerThread(url1,
-                    url2, url3, MapillaryLayer.getInstance()));
-        } catch (Exception e) {
-            Main.error(e);
-        }
-    }
+		try {
+			Main.info("GET " + url2 + " (Mapillary plugin)");
+			EXECUTOR.execute(new MapillarySquareDownloadManagerThread(url1, url2,
+					url3, MapillaryLayer.getInstance()));
+		} catch (Exception e) {
+			Main.error(e);
+		}
+	}
 
-    public void getImages(Bounds bounds) {
-        getImages(bounds.getMin(), bounds.getMax());
-    }
+	public void getImages(Bounds bounds) {
+		getImages(bounds.getMin(), bounds.getMax());
+	}
 
-    private String buildParameters(ConcurrentHashMap<String, Double> hash) {
-        String ret = "?client_id=" + CLIENT_ID;
-        for (int i = 0; i < parameters.length; i++)
-            if (hash.get(parameters[i]) != null)
-                ret += "&" + parameters[i] + "=" + hash.get(parameters[i]);
-        return ret;
-    }
+	private String buildParameters(ConcurrentHashMap<String, Double> hash) {
+		String ret = "?client_id=" + CLIENT_ID;
+		for (int i = 0; i < parameters.length; i++)
+			if (hash.get(parameters[i]) != null)
+				ret += "&" + parameters[i] + "=" + hash.get(parameters[i]);
+		return ret;
+	}
 }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java	(revision 31321)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java	(revision 31322)
@@ -91,8 +91,14 @@
 				boolean imagesAdded = false;
 				for (MapillaryImage img : finalImages) {
-					if (layer.data.getImages().contains(img))
+					if (layer.data.getImages().contains(img)) {
 						((MapillaryImage) layer.data.getImages().get(
 								layer.data.getImages().indexOf(img)))
 								.setSequence(sequence);
+						finalImages.set(
+								finalImages.indexOf(img),
+								(MapillaryImage) layer.data.getImages().get(
+										layer.data.getImages().indexOf(img)));
+					}
+
 					else {
 						img.setSequence(sequence);
@@ -101,6 +107,7 @@
 				}
 				manager.imagesAdded = imagesAdded;
-				layer.data.addWithoutUpdate(
-						new ArrayList<MapillaryAbstractImage>(finalImages));
+				layer.data
+						.addWithoutUpdate(new ArrayList<MapillaryAbstractImage>(
+								finalImages));
 				sequence.add(finalImages);
 			}
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java	(revision 31321)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java	(revision 31322)
@@ -14,5 +14,5 @@
 /**
  * This Class is needed to create an indeterminate amount of downloads, because
- * the Mapillary API has a param page which is needed when the amount of
+ * the Mapillary API has a paramameter called page which is needed when the amount of
  * requested images is quite big.
  * 
@@ -28,5 +28,5 @@
 	private final MapillaryLayer layer;
 	public boolean imagesAdded = false;
-
+	
 	public MapillarySquareDownloadManagerThread(String urlImages,
 			String urlSequences, String urlSigns, MapillaryLayer layer) {
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryToggleDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryToggleDialog.java	(revision 31321)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryToggleDialog.java	(revision 31322)
@@ -70,5 +70,5 @@
                 Shortcut.registerShortcut(tr("Mapillary dialog"),
                         tr("Open Mapillary main dialog"), KeyEvent.VK_M,
-                        Shortcut.NONE), 200);
+                        Shortcut.NONE), 200, false, MapillaryPreferenceSetting.class);
         MapillaryData.getInstance().addListener(this);
         addShortcuts();
@@ -146,7 +146,7 @@
                     title += " -- " + mapillaryImage.getDate();
                 setTitle(title);
+                // Enables/disables next/previous buttons
                 this.nextButton.setEnabled(false);
                 this.previousButton.setEnabled(false);
-                // Enables/disables next/previous buttons
                 if (((MapillaryImage) image).getSequence() != null) {
                     MapillaryImage tempImage = (MapillaryImage) image;
