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 31984)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31985)
@@ -14,5 +14,4 @@
 import java.awt.Rectangle;
 import java.awt.RenderingHints;
-import java.awt.Shape;
 import java.awt.TexturePaint;
 import java.awt.event.ActionEvent;
@@ -327,9 +326,11 @@
       if (imageAbs.isVisible()) {
         final Point p = mv.getPoint(imageAbs.getLatLon());
+        ImageIcon icon = MapillaryPlugin.MAP_ICON;
         if (getData().getMultiSelectedImages().contains(imageAbs)) {
-          draw(g, imageAbs, MapillaryPlugin.MAP_ICON_SELECTED, p);
-        } else {
-          draw(g, imageAbs, imageAbs instanceof MapillaryImage ? MapillaryPlugin.MAP_ICON : MapillaryPlugin.MAP_ICON_IMPORTED, p);
+          icon = MapillaryPlugin.MAP_ICON_SELECTED;
+        } else if (imageAbs instanceof MapillaryImportedImage) {
+          icon = MapillaryPlugin.MAP_ICON_IMPORTED;
         }
+        draw(g, imageAbs, icon, p);
         if (imageAbs instanceof MapillaryImage && !((MapillaryImage) imageAbs).getSigns().isEmpty()) {
           g.drawImage(
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java	(revision 31984)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java	(revision 31985)
@@ -15,11 +15,8 @@
 
 import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileNameExtensionFilter;
 
-import org.apache.commons.imaging.ImageReadException;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin;
 import org.openstreetmap.josm.plugins.mapillary.MapillarySequence;
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/UploadUtils.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/UploadUtils.java	(revision 31984)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/UploadUtils.java	(revision 31985)
@@ -40,4 +40,5 @@
 import org.apache.http.entity.mime.content.FileBody;
 import org.apache.http.entity.mime.content.StringBody;
+import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.openstreetmap.josm.Main;
@@ -246,23 +247,26 @@
   public static void uploadFile(File file, Map<String, String> hash) throws IOException {
     HttpClientBuilder builder = HttpClientBuilder.create();
-    HttpClient httpClient = builder.build();
     HttpPost httpPost = new HttpPost(UPLOAD_URL);
 
-    MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create();
-    for (String key : keys) {
-      if (hash.get(key) == null)
-        throw new IllegalArgumentException();
-      entityBuilder.addPart(key, new StringBody(hash.get(key),
-              ContentType.TEXT_PLAIN));
-    }
-    entityBuilder.addPart("file", new FileBody(file));
-    HttpEntity entity = entityBuilder.build();
-    httpPost.setEntity(entity);
-    HttpResponse response = httpClient.execute(httpPost);
-    if (response.getStatusLine().toString().contains("204")) {
-      PluginState.imageUploaded();
-      Main.info(PluginState.getUploadString() + " (Mapillary)");
-    } else
-      Main.info("Upload error");
+    try (CloseableHttpClient httpClient = builder.build()) {
+      MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create();
+      for (String key : keys) {
+        if (hash.get(key) == null)
+          throw new IllegalArgumentException();
+        entityBuilder.addPart(key, new StringBody(hash.get(key),
+                ContentType.TEXT_PLAIN));
+      }
+      entityBuilder.addPart("file", new FileBody(file));
+      HttpEntity entity = entityBuilder.build();
+      httpPost.setEntity(entity);
+      HttpResponse response = httpClient.execute(httpPost);
+
+      if (response.getStatusLine().toString().contains("204")) {
+        PluginState.imageUploaded();
+        Main.info(PluginState.getUploadString() + " (Mapillary)");
+      } else {
+        Main.info("Upload error");
+      }
+    }
     file.delete();
     MapillaryUtils.updateHelpText();
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapViewGeometryUtil.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapViewGeometryUtil.java	(revision 31984)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapViewGeometryUtil.java	(revision 31985)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.mapillary.utils;
 
@@ -43,5 +44,4 @@
       a.subtract(new Area(r));
     }
-    Shape s = null;
     return a;
   }
