Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java	(revision 32974)
@@ -17,5 +17,5 @@
  *
  */
-public class MapillaryAbstractImage implements Comparable<MapillaryAbstractImage> {
+public abstract class MapillaryAbstractImage implements Comparable<MapillaryAbstractImage> {
   /**
    * If two values for field ca differ by less than EPSILON both values are considered equal.
@@ -291,7 +291,12 @@
   }
 
-  @Override
+  /*@Override
   public int compareTo(MapillaryAbstractImage mapillaryAbstractImage) {
     return hashCode() - mapillaryAbstractImage.hashCode();
   }
+
+  @Override
+  public boolean equals(Object obj) {
+    return obj instanceof MapillaryAbstractImage && hashCode() == obj.hashCode();
+  }*/
 }
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 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java	(revision 32974)
@@ -129,5 +129,5 @@
       return this.key.compareTo(((MapillaryImage) image).getKey());
     }
-    return super.compareTo(image);
+    return hashCode() - image.hashCode();
   }
 
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImportedImage.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImportedImage.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImportedImage.java	(revision 32974)
@@ -90,7 +90,7 @@
   @Override
   public int compareTo(MapillaryAbstractImage image) {
-    if (image instanceof MapillaryImage)
+    if (image instanceof MapillaryImportedImage)
       return this.file.compareTo(((MapillaryImportedImage) image).getFile());
-    return super.compareTo(image);
+    return hashCode() - image.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 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 32974)
@@ -247,9 +247,5 @@
   @Override
   public boolean isModified() {
-    for (MapillaryAbstractImage image : this.data.getImages()) {
-      if (image.isModified())
-        return true;
-    }
-    return false;
+    return this.data.getImages().parallelStream().anyMatch(MapillaryAbstractImage::isModified);
   }
 
@@ -257,7 +253,5 @@
   public void setVisible(boolean visible) {
     super.setVisible(visible);
-    for (MapillaryAbstractImage img : this.data.getImages()) {
-      img.setVisible(visible);
-    }
+    this.data.getImages().parallelStream().forEach(img -> img.setVisible(visible));
     if (Main.map != null) {
       MapillaryFilterDialog.getInstance().refresh();
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java	(revision 32974)
@@ -63,5 +63,5 @@
 
   /** Cache that stores the pictures the downloaded pictures. */
-  public static CacheAccess<String, BufferedImageCacheEntry> cache;
+  private static CacheAccess<String, BufferedImageCacheEntry> cache;
 
   private static final MapillaryDownloadAction downloadAction = new MapillaryDownloadAction();
@@ -137,11 +137,9 @@
    *          Required information of the plugin. Obtained from the jar file.
    */
-  public MapillaryPlugin(PluginInformation info) {
+  public MapillaryPlugin(PluginInformation info) throws IOException {
     super(info);
 
-    try {
+    if (cache == null) {
       cache = JCSCacheManager.getCache("mapillary", 10, 10000, this.getPluginDir() + "/cache/");
-    } catch (IOException e) {
-      Main.error(e);
     }
 
@@ -286,3 +284,7 @@
     return new ImageProvider(s);
   }
+
+  public static CacheAccess<String, BufferedImageCacheEntry> getCache() {
+    return cache;
+  }
 }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java	(revision 32974)
@@ -38,8 +38,9 @@
    * Creates a sequence object with the given parameters.
    *
-   * @param key       The unique identifier of the sequence.
+   * @param key The unique identifier of the sequence.
    * @param createdAt The date the sequence was created.
+   *
    * @throws IllegalArgumentException if the key is invalid
-   *           according to {@link ValidationUtil#validateSequenceKey(String)}
+   * according to {@link ValidationUtil#validateSequenceKey(String)}
    */
   public MapillarySequence(String key, long createdAt) {
@@ -66,7 +67,5 @@
    */
   public synchronized void add(List<MapillaryAbstractImage> images) {
-    for (MapillaryAbstractImage image : images) {
-      add(image);
-    }
+    images.forEach(this::add);
   }
 
@@ -108,8 +107,10 @@
    *
    * @param image The {@link MapillaryAbstractImage} object whose next image is
-   *              going to be returned.
+   * going to be returned.
+   *
    * @return The next {@link MapillaryAbstractImage} object in the sequence.
+   *
    * @throws IllegalArgumentException if the given {@link MapillaryAbstractImage} object doesn't belong
-   *                                  the this sequence.
+   * the this sequence.
    */
   public MapillaryAbstractImage next(MapillaryAbstractImage image) {
@@ -129,8 +130,10 @@
    *
    * @param image The {@link MapillaryAbstractImage} object whose previous image is
-   *              going to be returned.
+   * going to be returned.
+   *
    * @return The previous {@link MapillaryAbstractImage} object in the sequence.
+   *
    * @throws IllegalArgumentException if the given {@link MapillaryAbstractImage} object doesn't belong
-   *                                  the this sequence.
+   * the this sequence.
    */
   public MapillaryAbstractImage previous(MapillaryAbstractImage image) {
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySign.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySign.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySign.java	(revision 32974)
@@ -6,4 +6,5 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Map;
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java	(revision 32974)
@@ -98,5 +98,5 @@
       }
       try {
-        Main.worker.submit(new Thread(new MapillaryExportManager(images)));
+        Main.worker.submit(new MapillaryExportManager(images));
       } catch (IOException e1) {
         Main.error(e1);
@@ -113,6 +113,6 @@
    */
   public void export(Set<MapillaryAbstractImage> images) {
-    Main.worker.submit(new Thread(new MapillaryExportManager(images,
-        this.dialog.chooser.getSelectedFile().toString())));
+    Main.worker.submit(new MapillaryExportManager(images,
+        this.dialog.chooser.getSelectedFile().toString()));
   }
 
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 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java	(revision 32974)
@@ -8,4 +8,5 @@
 import java.io.File;
 import java.io.IOException;
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -103,5 +104,5 @@
    */
   public static class MapillaryEpochComparator implements
-      Comparator<MapillaryAbstractImage> {
+      Comparator<MapillaryAbstractImage>, Serializable {
 
     @Override
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java	(revision 32974)
@@ -44,5 +44,5 @@
    */
   public MapillaryCache(String key, Type type) {
-    super(MapillaryPlugin.cache, 50000, 50000, new HashMap<String, String>());
+    super(MapillaryPlugin.getCache(), 50000, 50000, new HashMap<String, String>());
     String k = null;
     URL u = null;
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/FinishedUploadDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/FinishedUploadDialog.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/FinishedUploadDialog.java	(revision 32974)
@@ -44,5 +44,5 @@
   }
 
-  private class WebAction implements ActionListener {
+  private static class WebAction implements ActionListener {
     @Override
     public void actionPerformed(ActionEvent e) {
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryChangesetDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryChangesetDialog.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryChangesetDialog.java	(revision 32974)
@@ -146,5 +146,5 @@
   }
 
-  private class SubmitAction extends AbstractAction {
+  private static class SubmitAction extends AbstractAction {
 
     private static final long serialVersionUID = -2761935780353053512L;
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java	(revision 32974)
@@ -11,4 +11,5 @@
 import java.util.Arrays;
 import java.util.Calendar;
+import java.util.function.Predicate;
 import java.util.regex.Pattern;
 
@@ -72,24 +73,24 @@
    */
   private static final String[] SIGN_TAGS = {"prohibitory--maximum-speed-limit",
-          "regulatory|priority--stop", "regulatory|priority--give_way|yield", "warning|mandatory--roundabout",
-          "prohibitory|regulatory--no-entry|no-traffic-both-ways",
-          "crossroads|junction", "mandatory--turn|straight", "uneven|slippery",
-          "no-parking", "no_overtaking",
-          "danger_pedestrian_crossing", "no_*_turn"};
+    "regulatory|priority--stop", "regulatory|priority--give_way|yield", "warning|mandatory--roundabout",
+    "prohibitory|regulatory--no-entry|no-traffic-both-ways",
+    "crossroads|junction", "mandatory--turn|straight", "uneven|slippery",
+    "no-parking", "no_overtaking",
+    "danger_pedestrian_crossing", "no_*_turn"};
   /**
    * The {@link JCheckBox} where the respective tag should be searched
    */
   private final JCheckBox[] SIGN_CHECKBOXES = {this.signFilter.maxSpeed,
-          this.signFilter.stop, this.signFilter.giveWay,
-          this.signFilter.roundabout, this.signFilter.access, this.signFilter.intersection,
-          this.signFilter.direction, this.signFilter.uneven,
-          this.signFilter.noParking, this.signFilter.noOvertaking,
-          this.signFilter.crossing, this.signFilter.noTurn};
+    this.signFilter.stop, this.signFilter.giveWay,
+    this.signFilter.roundabout, this.signFilter.access, this.signFilter.intersection,
+    this.signFilter.direction, this.signFilter.uneven,
+    this.signFilter.noParking, this.signFilter.noOvertaking,
+    this.signFilter.crossing, this.signFilter.noTurn};
 
   private MapillaryFilterDialog() {
     super(tr("Mapillary filter"), "mapillary-filter.svg",
-            tr("Open Mapillary filter dialog"), Shortcut.registerShortcut(
-                    tr("Mapillary filter"), tr("Open Mapillary filter dialog"),
-                    KeyEvent.VK_M, Shortcut.NONE), 200);
+      tr("Open Mapillary filter dialog"), Shortcut.registerShortcut(
+        tr("Mapillary filter"), tr("Open Mapillary filter dialog"),
+        KeyEvent.VK_M, Shortcut.NONE), 200);
 
     this.signChooser.setEnabled(false);
@@ -179,47 +180,34 @@
     boolean onlySigns = this.onlySigns.isSelected();
 
-    for (MapillaryAbstractImage img : MapillaryLayer.getInstance().getData().getImages()) {
-      img.setVisible(true);
-      if (img instanceof MapillaryImportedImage) {
-        if (!imported)
-          img.setVisible(false);
-        continue;
-      } else if (img instanceof MapillaryImage) {
-        if (!downloaded) {
-          img.setVisible(false);
-          continue;
-        }
-        if (onlySigns) {
-          if (((MapillaryImage) img).getSigns().isEmpty()) {
-            img.setVisible(false);
-            continue;
-          }
-          if (!checkSigns((MapillaryImage) img)) {
-            img.setVisible(false);
-            continue;
-          }
-        }
-        if (!"".equals(user.getText())
-                && !this.user.getText().equals(((MapillaryImage) img).getUser())) {
-          img.setVisible(false);
-          continue;
-        }
+    // This predicate returns true is the image should be made invisible
+    Predicate<MapillaryAbstractImage> p =
+      img ->
+        (img instanceof MapillaryImportedImage && !imported) ||
+          (img instanceof MapillaryImage &&
+            (!downloaded ||
+              (onlySigns && (((MapillaryImage) img).getSigns().isEmpty() || !checkSigns((MapillaryImage) img))) ||
+              (!user.getText().equals("") && !this.user.getText().equals(((MapillaryImage) img).getUser())))) ||
+          checkValidTime(img);
+
+    MapillaryLayer.getInstance().getData().getImages().parallelStream().forEach(img -> img.setVisible(!p.test(img)));
+
+    Main.map.repaint();
+  }
+
+  private boolean checkValidTime(MapillaryAbstractImage img) {
+    Long currentTime = currentTime();
+    long[] timeFactor = new long[]{
+      31_536_000_000L, // = 365 * 24 * 60 * 60 * 1000 = number of ms in a year
+      2_592_000_000L, // = 30 * 24 * 60 * 60 * 1000 = number of ms in a month
+      86_400_000 // = 24 * 60 * 60 * 1000 = number of ms in a day
+    };
+    for (int i = 1; i <= 3; i++) {
+      if (TIME_LIST[i].equals(time.getSelectedItem())
+        && img.getCapturedAt() < currentTime - ((Integer) spinner.getValue()).longValue() * timeFactor[i - 1]
+        ) {
+        return true;
       }
-      // Calculates the amount of days since the image was taken
-      Long currentTime = currentTime();
-      long[] timeFactor = new long[]{
-              31_536_000_000L, // = 365 * 24 * 60 * 60 * 1000 = number of ms in a year
-              2_592_000_000L, // = 30 * 24 * 60 * 60 * 1000 = number of ms in a month
-              86_400_000 // = 24 * 60 * 60 * 1000 = number of ms in a day
-      };
-      for (int i = 1; i <= 3; i++) {
-        if (TIME_LIST[i].equals(time.getSelectedItem())
-                && img.getCapturedAt() < currentTime - ((Integer) spinner.getValue()).longValue() * timeFactor[i - 1]
-                ) {
-          img.setVisible(false);
-        }
-      }
-    }
-    Main.map.repaint();
+    }
+    return false;
   }
 
@@ -228,5 +216,6 @@
    *
    * @param img The {@link MapillaryAbstractImage} object that is going to be
-   *            checked.
+   * checked.
+   *
    * @return {@code true} if it fulfills the conditions; {@code false}
    * otherwise.
@@ -245,5 +234,5 @@
       String[] parts = signTag.split("--");
       if (Pattern.compile(parts[0]).matcher(sign.getCategory()).find() &&
-              Pattern.compile(parts[1]).matcher(sign.getType()).find()) {
+        Pattern.compile(parts[1]).matcher(sign.getType()).find()) {
         contains = true;
       }
@@ -341,5 +330,5 @@
       JPanel dialog = MapillaryFilterChooseSigns.getInstance();
       JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE,
-              JOptionPane.OK_CANCEL_OPTION);
+        JOptionPane.OK_CANCEL_OPTION);
       JDialog dlg = pane.createDialog(Main.parent, tr("Choose signs"));
       dlg.setVisible(true);
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java	(revision 32974)
@@ -185,5 +185,5 @@
    *
    */
-  private class LoginAction extends AbstractAction {
+  private static class LoginAction extends AbstractAction {
     private static final long serialVersionUID = -3908477563072057344L;
     private final transient MapillaryLoginListener callback;
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java	(revision 32974)
@@ -53,5 +53,5 @@
     MapillaryAbstractImage closest = getClosest(e.getPoint());
     if (!(Main.getLayerManager().getActiveLayer() instanceof MapillaryLayer)
-            && closest != null && Main.map.mapMode == Main.map.mapModeSelect) {
+      && closest != null && Main.map.mapMode == Main.map.mapModeSelect) {
       this.lastClicked = this.closest;
       this.data.setSelectedImage(closest);
@@ -62,7 +62,5 @@
     // Double click
     if (e.getClickCount() == 2 && this.data.getSelectedImage() != null && closest != null) {
-      for (MapillaryAbstractImage img : closest.getSequence().getImages()) {
-        this.data.addMultiSelectedImage(img);
-      }
+      closest.getSequence().getImages().forEach(data::addMultiSelectedImage);
     }
     this.lastClicked = this.closest;
@@ -76,13 +74,13 @@
       // shift + click
     } else if (
-        e.getModifiers() == (InputEvent.BUTTON1_MASK | InputEvent.SHIFT_MASK)
+      e.getModifiers() == (InputEvent.BUTTON1_MASK | InputEvent.SHIFT_MASK)
         && this.lastClicked instanceof MapillaryImage
-    ) {
-      if (this.closest != null && this.lastClicked != null
-              && this.closest.getSequence() == (this.lastClicked).getSequence()) {
+      ) {
+      if (this.closest != null
+        && this.closest.getSequence() == (this.lastClicked).getSequence()) {
         int i = this.closest.getSequence().getImages().indexOf(this.closest);
         int j = this.lastClicked.getSequence().getImages().indexOf(this.lastClicked);
         this.data.addMultiSelectedImage(
-            i < j
+          i < j
             ? new ConcurrentSkipListSet<>(this.closest.getSequence().getImages().subList(i, j + 1))
             : new ConcurrentSkipListSet<>(this.closest.getSequence().getImages().subList(j, i + 1))
@@ -100,22 +98,16 @@
     if (
       Main.getLayerManager().getActiveLayer() == MapillaryLayer.getInstance()
-      && SwingUtilities.isLeftMouseButton(e)
-      && highlightImg != null && highlightImg.getLatLon() != null
-    ) {
+        && SwingUtilities.isLeftMouseButton(e)
+        && highlightImg != null && highlightImg.getLatLon() != null
+      ) {
       Point highlightImgPoint = Main.map.mapView.getPoint(highlightImg.getTempLatLon());
       if (e.isShiftDown()) { // turn
-        for (MapillaryAbstractImage img : data.getMultiSelectedImages()) {
-          if (!(img instanceof MapillaryImage)) {
-            img.turn(Math.toDegrees(Math.atan2(e.getX() - highlightImgPoint.getX(), -e.getY() + highlightImgPoint.getY())) - highlightImg.getTempCa());
-          }
-        }
+        this.data.getMultiSelectedImages().parallelStream().filter(img -> !(img instanceof MapillaryImage))
+          .forEach(img -> img.turn(Math.toDegrees(Math.atan2(e.getX() - highlightImgPoint.getX(), -e.getY() + highlightImgPoint.getY())) - highlightImg.getTempCa()));
       } else { // move
-        for (MapillaryAbstractImage img : this.data.getMultiSelectedImages()) {
-          if (!(img instanceof MapillaryImage)) {
-            LatLon eventLatLon = Main.map.mapView.getLatLon(e.getX(), e.getY());
-            LatLon imgLatLon = Main.map.mapView.getLatLon(highlightImgPoint.getX(), highlightImgPoint.getY());
-            img.move(eventLatLon.getX() - imgLatLon.getX(), eventLatLon.getY() - imgLatLon.getY());
-          }
-        }
+        LatLon eventLatLon = Main.map.mapView.getLatLon(e.getX(), e.getY());
+        LatLon imgLatLon = Main.map.mapView.getLatLon(highlightImgPoint.getX(), highlightImgPoint.getY());
+        this.data.getMultiSelectedImages().parallelStream().filter(img -> !(img instanceof MapillaryImage))
+          .forEach(img -> img.move(eventLatLon.getX() - imgLatLon.getX(), eventLatLon.getY() - imgLatLon.getY()));
       }
       Main.map.repaint();
@@ -131,16 +123,13 @@
       double to = this.data.getSelectedImage().getMovingCa();
       this.record.addCommand(new CommandTurn(this.data.getMultiSelectedImages(), to
-              - from));
+        - from));
     } else if (this.data.getSelectedImage().getTempLatLon() != this.data
-            .getSelectedImage().getMovingLatLon()) {
+      .getSelectedImage().getMovingLatLon()) {
       LatLon from = this.data.getSelectedImage().getTempLatLon();
       LatLon to = this.data.getSelectedImage().getMovingLatLon();
       this.record.addCommand(new CommandMove(this.data.getMultiSelectedImages(), to
-              .getX() - from.getX(), to.getY() - from.getY()));
+        .getX() - from.getX(), to.getY() - from.getY()));
     }
-    for (MapillaryAbstractImage img : this.data.getMultiSelectedImages()) {
-      if (img != null)
-        img.stopMoving();
-    }
+    this.data.getMultiSelectedImages().parallelStream().filter(img -> img != null).forEach(MapillaryAbstractImage::stopMoving);
   }
 
@@ -151,5 +140,5 @@
   public void mouseMoved(MouseEvent e) {
     if (Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer
-            && Main.map.mapMode != Main.map.mapModeSelect) {
+      && Main.map.mapMode != Main.map.mapModeSelect) {
       return;
     }
@@ -161,21 +150,21 @@
 
     if (closestTemp != null
-            && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer
-            && !this.imageHighlighted) {
+      && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer
+      && !this.imageHighlighted) {
       Main.map.mapMode.putValue("active", Boolean.FALSE);
       this.imageHighlighted = true;
 
     } else if (closestTemp == null
-            && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer
-            && this.imageHighlighted && this.nothingHighlighted) {
+      && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer
+      && this.imageHighlighted && this.nothingHighlighted) {
       this.nothingHighlighted = false;
       Main.map.mapMode.putValue("active", Boolean.TRUE);
 
     } else if (this.imageHighlighted && !this.nothingHighlighted
-            && Main.getLayerManager().getEditLayer().data != null
-            && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer) {
+      && Main.getLayerManager().getEditLayer().data != null
+      && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer) {
 
       for (OsmPrimitive primivitive : Main.getLayerManager().getEditLayer().data
-              .allPrimitives()) {
+        .allPrimitives()) {
         primivitive.setHighlighted(false);
       }
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 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/UploadUtils.java	(revision 32974)
@@ -273,5 +273,7 @@
       }
     }
-    file.delete();
+    if (!file.delete()) {
+      Main.error("MapillaryPlugin: File could not be deleted during upload");
+    }
     MapillaryUtils.updateHelpText();
   }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/ImageUtil.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/ImageUtil.java	(revision 32973)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/ImageUtil.java	(revision 32974)
@@ -48,5 +48,5 @@
       for (File child : f.listFiles()) {
         try {
-          images.addAll(readImagesFrom(child, defaultLL));
+          assert images.addAll(readImagesFrom(child, defaultLL));
         } catch (IOException e) {
           // Don't throw an exception here to allow other files that might be readable to be read.
