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 31354)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java	(revision 31355)
@@ -24,4 +24,6 @@
   /** The time the image was captured, in Epoch format */
   private long capturedAt;
+  /** Sequence of pictures containing this object */
+  private MapillarySequence sequence;
   /** Position of the picture */
   public final LatLon latLon;
@@ -105,6 +107,5 @@
    */
   public void move(double x, double y) {
-    this.movingLatLon = new LatLon(this.tempLatLon.getY() + y,
-        this.tempLatLon.getX() + x);
+    this.movingLatLon = new LatLon(this.tempLatLon.getY() + y, this.tempLatLon.getX() + x);
     this.isModified = true;
   }
@@ -203,5 +204,5 @@
     SimpleDateFormat formatter = new SimpleDateFormat(format);
     try {
-      Date dateTime = formatter.parse(date);
+      Date dateTime = (Date) formatter.parse(date);
       return dateTime.getTime();
     } catch (ParseException e) {
@@ -220,3 +221,50 @@
     return cal.getTimeInMillis();
   }
+
+  /**
+   * 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;
+  }
+
+  /**
+   * If the MapillaryImage belongs to a MapillarySequence, returns the next
+   * MapillarySequence in it.
+   * 
+   * @return The following MapillaryImage, or null if there is none.
+   */
+  public MapillaryAbstractImage next() {
+    synchronized (lock) {
+      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 MapillaryAbstractImage previous() {
+    synchronized (lock) {
+      if (this.getSequence() == null)
+        return null;
+      return this.getSequence().previous(this);
+    }
+  }
 }
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31354)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31355)
@@ -170,5 +170,5 @@
       if (selectedImage instanceof MapillaryImage
           && ((MapillaryImage) selectedImage).getSequence() != null) {
-        MapillaryImage tempImage = (MapillaryImage) selectedImage;
+        MapillaryAbstractImage tempImage = selectedImage;
         while (tempImage.next() != null) {
           tempImage = tempImage.next();
@@ -196,5 +196,5 @@
       if (selectedImage instanceof MapillaryImage
           && ((MapillaryImage) selectedImage).getSequence() != null) {
-        MapillaryImage tempImage = (MapillaryImage) selectedImage;
+        MapillaryAbstractImage tempImage = selectedImage;
         while (tempImage.previous() != null) {
           tempImage = tempImage.previous();
@@ -242,15 +242,15 @@
         // Donwloadins thumbnails of surrounding pictures.
         if (mapillaryImage.next() != null) {
-          new MapillaryCache(mapillaryImage.next().getKey(),
+          new MapillaryCache(((MapillaryImage) mapillaryImage.next()).getKey(),
               MapillaryCache.Type.THUMBNAIL).submit(this, false);
           if (mapillaryImage.next().next() != null)
-            new MapillaryCache(mapillaryImage.next().next().getKey(),
+            new MapillaryCache(((MapillaryImage) mapillaryImage.next().next()).getKey(),
                 MapillaryCache.Type.THUMBNAIL).submit(this, false);
         }
         if (mapillaryImage.previous() != null) {
-          new MapillaryCache(mapillaryImage.previous().getKey(),
+          new MapillaryCache(((MapillaryImage) mapillaryImage.previous()).getKey(),
               MapillaryCache.Type.THUMBNAIL).submit(this, false);
           if (mapillaryImage.previous().previous() != null)
-            new MapillaryCache(mapillaryImage.previous().previous().getKey(),
+            new MapillaryCache(((MapillaryImage) mapillaryImage.previous().previous()).getKey(),
                 MapillaryCache.Type.THUMBNAIL).submit(this, false);
         }
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 31354)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java	(revision 31355)
@@ -14,6 +14,4 @@
   /** Unique identifier of the object */
   private final String key;
-  /** Sequence of pictures containing this object */
-  private MapillarySequence sequence;
 
   /** The user that made the image */
@@ -91,55 +89,6 @@
   }
 
-  /**
-   * 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;
-  }
-
-  @Override
   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() {
-    synchronized (lock) {
-      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() {
-    synchronized (lock) {
-      if (this.getSequence() == null)
-        return null;
-      return this.getSequence().previous(this);
-    }
+    return "Image[key=" + this.key + ";lat=" + this.latLon.lat() + ";lon=" + this.latLon.lon() + ";ca=" + this.ca + "]";
   }
 
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 31354)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31355)
@@ -302,21 +302,22 @@
         continue;
       Point p = mv.getPoint(imageAbs.getLatLon());
+      
+      Point nextp = null;
+      // Draw sequence line
+      if (imageAbs.getSequence() != null) {
+        MapillaryAbstractImage tempImage = imageAbs.next();
+        while (tempImage != null) {
+          if (tempImage.isVisible()) {
+            nextp = mv.getPoint(tempImage.getLatLon());
+            break;
+          }
+          tempImage = tempImage.next();
+        }
+        if (nextp != null)
+          g.drawLine(p.x, p.y, nextp.x, nextp.y);
+      }
+      
       if (imageAbs instanceof MapillaryImage) {
         MapillaryImage image = (MapillaryImage) imageAbs;
-        Point nextp = null;
-        // Draw sequence line
-        if (image.getSequence() != null) {
-          MapillaryImage tempImage = image.next();
-          while (tempImage != null) {
-            if (tempImage.isVisible()) {
-              nextp = mv.getPoint(tempImage.getLatLon());
-              break;
-            }
-            tempImage = tempImage.next();
-          }
-          if (nextp != null)
-            g.drawLine(p.x, p.y, nextp.x, nextp.y);
-        }
-
         ImageIcon icon;
         if (!data.getMultiSelectedImages().contains(image))
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryMouseAdapter.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryMouseAdapter.java	(revision 31354)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryMouseAdapter.java	(revision 31355)
@@ -43,17 +43,15 @@
       return;
     MapillaryAbstractImage closestTemp = getClosest(e.getPoint());
-    if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer
-        && closestTemp != null && Main.map.mapMode == Main.map.mapModeSelect) {
+    if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer && closestTemp != null
+        && Main.map.mapMode == Main.map.mapModeSelect) {
       this.lastClicked = this.closest;
       MapillaryData.getInstance().setSelectedImage(closestTemp);
       return;
-    } else if (Main.map.mapView.getActiveLayer() != MapillaryLayer
-        .getInstance())
+    } else if (Main.map.mapView.getActiveLayer() != MapillaryLayer.getInstance())
       return;
     if (closestTemp instanceof MapillaryImage || closestTemp == null) {
       MapillaryImage closest = (MapillaryImage) closestTemp;
       // Doube click
-      if (e.getClickCount() == 2 && mapillaryData.getSelectedImage() != null
-          && closest != null) {
+      if (e.getClickCount() == 2 && mapillaryData.getSelectedImage() != null && closest != null) {
         for (MapillaryAbstractImage img : closest.getSequence().getImages()) {
           mapillaryData.addMultiSelectedImage(img);
@@ -66,29 +64,19 @@
         return;
       // ctrl+click
-      if (e.getModifiers() == (MouseEvent.BUTTON1_MASK | MouseEvent.CTRL_MASK)
-          && closest != null)
+      if (e.getModifiers() == (MouseEvent.BUTTON1_MASK | MouseEvent.CTRL_MASK) && closest != null)
         mapillaryData.addMultiSelectedImage(closest);
       // shift + click
       else if (e.getModifiers() == (MouseEvent.BUTTON1_MASK | MouseEvent.SHIFT_MASK)
-          && this.closest instanceof MapillaryImage
-          && this.lastClicked instanceof MapillaryImage) {
-        if (this.closest != null
-            && this.lastClicked != null
-            && ((MapillaryImage) this.closest).getSequence() == ((MapillaryImage) this.lastClicked)
-                .getSequence()) {
-          int i = ((MapillaryImage) this.closest).getSequence().getImages()
-              .indexOf(this.closest);
-          int j = ((MapillaryImage) this.lastClicked).getSequence().getImages()
-              .indexOf(this.lastClicked);
+          && this.closest instanceof MapillaryImage && this.lastClicked instanceof MapillaryImage) {
+        if (this.closest != null && this.lastClicked != null
+            && ((MapillaryImage) this.closest).getSequence() == ((MapillaryImage) this.lastClicked).getSequence()) {
+          int i = ((MapillaryImage) this.closest).getSequence().getImages().indexOf(this.closest);
+          int j = ((MapillaryImage) this.lastClicked).getSequence().getImages().indexOf(this.lastClicked);
           if (i < j)
-            mapillaryData
-                .addMultiSelectedImage(new ArrayList<MapillaryAbstractImage>(
-                    ((MapillaryImage) this.closest).getSequence().getImages()
-                        .subList(i, j + 1)));
+            mapillaryData.addMultiSelectedImage(new ArrayList<>(((MapillaryImage) this.closest).getSequence()
+                .getImages().subList(i, j + 1)));
           else
-            mapillaryData
-                .addMultiSelectedImage(new ArrayList<MapillaryAbstractImage>(
-                    ((MapillaryImage) this.closest).getSequence().getImages()
-                        .subList(j, i + 1)));
+            mapillaryData.addMultiSelectedImage(new ArrayList<>(((MapillaryImage) this.closest).getSequence()
+                .getImages().subList(j, i + 1)));
         }
         // click
@@ -103,6 +91,5 @@
       if (mapillaryData.getMultiSelectedImages().contains(closest))
         return;
-      if (e.getModifiers() == (MouseEvent.BUTTON1_MASK | MouseEvent.CTRL_MASK)
-          && closest != null)
+      if (e.getModifiers() == (MouseEvent.BUTTON1_MASK | MouseEvent.CTRL_MASK) && closest != null)
         mapillaryData.addMultiSelectedImage(closest);
       else
@@ -119,6 +106,5 @@
       imagePoint.setLocation(imagePoint.getX(), imagePoint.getY());
       double dist = clickPoint.distanceSq(imagePoint);
-      if (minDistance > dist && clickPoint.distance(imagePoint) < snapDistance
-          && image.isVisible()) {
+      if (minDistance > dist && clickPoint.distance(imagePoint) < snapDistance && image.isVisible()) {
         minDistance = dist;
         closest = image;
@@ -134,6 +120,5 @@
 
     if (!Main.pref.getBoolean("mapillary.developer"))
-      for (MapillaryAbstractImage img : MapillaryData.getInstance()
-          .getMultiSelectedImages()) {
+      for (MapillaryAbstractImage img : MapillaryData.getInstance().getMultiSelectedImages()) {
         if (img instanceof MapillaryImage)
           return;
@@ -143,6 +128,5 @@
         LatLon to = Main.map.mapView.getLatLon(e.getX(), e.getY());
         LatLon from = Main.map.mapView.getLatLon(start.getX(), start.getY());
-        for (MapillaryAbstractImage img : MapillaryData.getInstance()
-            .getMultiSelectedImages()) {
+        for (MapillaryAbstractImage img : MapillaryData.getInstance().getMultiSelectedImages()) {
 
           img.move(to.getX() - from.getX(), to.getY() - from.getY());
@@ -150,11 +134,8 @@
         Main.map.repaint();
       } else if (lastButton == MouseEvent.BUTTON1 && e.isShiftDown()) {
-        this.closest.turn(Math.toDegrees(Math.atan2((e.getX() - start.x),
-            -(e.getY() - start.y)))
-            - closest.getTempCa());
-        for (MapillaryAbstractImage img : MapillaryData.getInstance()
-            .getMultiSelectedImages()) {
-          img.turn(Math.toDegrees(Math.atan2((e.getX() - start.x),
-              -(e.getY() - start.y))) - closest.getTempCa());
+        this.closest
+            .turn(Math.toDegrees(Math.atan2((e.getX() - start.x), -(e.getY() - start.y))) - closest.getTempCa());
+        for (MapillaryAbstractImage img : MapillaryData.getInstance().getMultiSelectedImages()) {
+          img.turn(Math.toDegrees(Math.atan2((e.getX() - start.x), -(e.getY() - start.y))) - closest.getTempCa());
         }
         Main.map.repaint();
@@ -167,16 +148,12 @@
     if (mapillaryData.getSelectedImage() == null)
       return;
-    if (mapillaryData.getSelectedImage().getTempCa() != mapillaryData
-        .getSelectedImage().getCa()) {
+    if (mapillaryData.getSelectedImage().getTempCa() != mapillaryData.getSelectedImage().getCa()) {
       double from = mapillaryData.getSelectedImage().getTempCa();
       double to = mapillaryData.getSelectedImage().getCa();
-      record.addCommand(new CommandTurnImage(mapillaryData
-          .getMultiSelectedImages(), to - from));
-    } else if (mapillaryData.getSelectedImage().getTempLatLon() != mapillaryData
-        .getSelectedImage().getLatLon()) {
+      record.addCommand(new CommandTurnImage(mapillaryData.getMultiSelectedImages(), to - from));
+    } else if (mapillaryData.getSelectedImage().getTempLatLon() != mapillaryData.getSelectedImage().getLatLon()) {
       LatLon from = mapillaryData.getSelectedImage().getTempLatLon();
       LatLon to = mapillaryData.getSelectedImage().getLatLon();
-      record.addCommand(new CommandMoveImage(mapillaryData
-          .getMultiSelectedImages(), to.getX() - from.getX(), to.getY()
+      record.addCommand(new CommandMoveImage(mapillaryData.getMultiSelectedImages(), to.getX() - from.getX(), to.getY()
           - from.getY()));
     }
@@ -193,26 +170,19 @@
   public void mouseMoved(MouseEvent e) {
     MapillaryAbstractImage closestTemp = getClosest(e.getPoint());
-    if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer
-        && Main.map.mapMode != Main.map.mapModeSelect)
-      return;
-    if (closestTemp != null
-        && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer
-        && !imageHighlighted) {
+    if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer && Main.map.mapMode != Main.map.mapModeSelect)
+      return;
+    if (closestTemp != null && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer && !imageHighlighted) {
       Main.map.mapMode.putValue("active", Boolean.FALSE);
       imageHighlighted = true;
 
-    } else if (closestTemp == null
-        && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer
-        && imageHighlighted && nothingHighlighted) {
+    } else if (closestTemp == null && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer && imageHighlighted
+        && nothingHighlighted) {
       nothingHighlighted = false;
       Main.map.mapMode.putValue("active", Boolean.TRUE);
 
-    } else if (imageHighlighted && !nothingHighlighted
-        && Main.map.mapView != null
-        && Main.map.mapView.getEditLayer().data != null
-        && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) {
-
-      for (OsmPrimitive primivitive : Main.map.mapView.getEditLayer().data
-          .allPrimitives()) {
+    } else if (imageHighlighted && !nothingHighlighted && Main.map.mapView != null
+        && Main.map.mapView.getEditLayer().data != null && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) {
+
+      for (OsmPrimitive primivitive : Main.map.mapView.getEditLayer().data.allPrimitives()) {
         primivitive.setHighlighted(false);
       }
@@ -221,14 +191,11 @@
     }
 
-    if (MapillaryData.getInstance().getHoveredImage() != closestTemp
-        && closestTemp != null) {
+    if (MapillaryData.getInstance().getHoveredImage() != closestTemp && closestTemp != null) {
       MapillaryData.getInstance().setHighlightedImage(closestTemp);
       MapillaryMainDialog.getInstance().setImage(closestTemp);
       MapillaryMainDialog.getInstance().updateImage();
-    } else if (MapillaryData.getInstance().getHoveredImage() != closestTemp
-        && closestTemp == null) {
+    } else if (MapillaryData.getInstance().getHoveredImage() != closestTemp && closestTemp == null) {
       MapillaryData.getInstance().setHighlightedImage(null);
-      MapillaryMainDialog.getInstance().setImage(
-          MapillaryData.getInstance().getSelectedImage());
+      MapillaryMainDialog.getInstance().setImage(MapillaryData.getInstance().getSelectedImage());
       MapillaryMainDialog.getInstance().updateImage();
     }
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 31354)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java	(revision 31355)
@@ -35,10 +35,7 @@
   public static final ImageIcon ICON24 = new ImageProvider("icon24.png").get();
   public static final ImageIcon ICON16 = new ImageProvider("icon16.png").get();
-  public static final ImageIcon MAP_ICON = new ImageProvider("mapicon.png")
-      .get();
-  public static final ImageIcon MAP_ICON_SELECTED = new ImageProvider(
-      "mapiconselected.png").get();
-  public static final ImageIcon MAP_ICON_IMPORTED = new ImageProvider(
-      "mapiconimported.png").get();
+  public static final ImageIcon MAP_ICON = new ImageProvider("mapicon.png").get();
+  public static final ImageIcon MAP_ICON_SELECTED = new ImageProvider("mapiconselected.png").get();
+  public static final ImageIcon MAP_ICON_IMPORTED = new ImageProvider("mapiconimported.png").get();
   public static final ImageIcon MAP_SIGN = new ImageProvider("sign.png").get();
   public static final int ICON_SIZE = 24;
@@ -51,4 +48,5 @@
   private final MapillaryZoomAction zoomAction;
   private final MapillaryDownloadViewAction downloadViewAction;
+  private final MapillaryImportIntoSequenceAction importIntoSequenceAction;
 
   public static JMenuItem DOWNLOAD_MENU;
@@ -57,4 +55,5 @@
   public static JMenuItem ZOOM_MENU;
   public static JMenuItem DOWNLOAD_VIEW_MENU;
+  public static JMenuItem IMPORT_INTO_SEQUENCE_MENU;
 
   public MapillaryPlugin(PluginInformation info) {
@@ -65,15 +64,13 @@
     zoomAction = new MapillaryZoomAction();
     downloadViewAction = new MapillaryDownloadViewAction();
+    importIntoSequenceAction = new MapillaryImportIntoSequenceAction();
 
     if (Main.main != null) { // important for headless mode
-      DOWNLOAD_MENU = MainMenu.add(Main.main.menu.imageryMenu, downloadAction,
-          false);
-      EXPORT_MENU = MainMenu.add(Main.main.menu.fileMenu, exportAction, false,
-          14);
-      IMPORT_MENU = MainMenu.add(Main.main.menu.fileMenu, importAction, false,
-          14);
+      DOWNLOAD_MENU = MainMenu.add(Main.main.menu.imageryMenu, downloadAction, false);
+      EXPORT_MENU = MainMenu.add(Main.main.menu.fileMenu, exportAction, false, 14);
+      IMPORT_INTO_SEQUENCE_MENU = MainMenu.add(Main.main.menu.fileMenu, importIntoSequenceAction, false, 14);
+      IMPORT_MENU = MainMenu.add(Main.main.menu.fileMenu, importAction, false, 14);
       ZOOM_MENU = MainMenu.add(Main.main.menu.viewMenu, zoomAction, false, 15);
-      DOWNLOAD_VIEW_MENU = MainMenu.add(Main.main.menu.fileMenu,
-          downloadViewAction, false, 14);
+      DOWNLOAD_VIEW_MENU = MainMenu.add(Main.main.menu.fileMenu, downloadViewAction, false, 14);
     }
 
@@ -81,4 +78,5 @@
     DOWNLOAD_MENU.setEnabled(false);
     IMPORT_MENU.setEnabled(false);
+    IMPORT_INTO_SEQUENCE_MENU.setEnabled(false);
     ZOOM_MENU.setEnabled(false);
     DOWNLOAD_VIEW_MENU.setEnabled(false);
@@ -86,6 +84,5 @@
     MapView.addEditLayerChangeListener(this);
     try {
-      CACHE = JCSCacheManager.getCache("mapillary", 10, 10000,
-          this.getPluginDir() + "/cache/");
+      CACHE = JCSCacheManager.getCache("mapillary", 10, 10000, this.getPluginDir() + "/cache/");
     } catch (IOException e) {
       Main.error(e);
@@ -106,4 +103,5 @@
         setMenuEnabled(DOWNLOAD_VIEW_MENU, true);
       setMenuEnabled(IMPORT_MENU, true);
+      setMenuEnabled(IMPORT_INTO_SEQUENCE_MENU, true);
     }
     if (oldFrame != null && newFrame == null) { // map frame destroyed
@@ -114,4 +112,5 @@
       setMenuEnabled(DOWNLOAD_VIEW_MENU, false);
       setMenuEnabled(IMPORT_MENU, false);
+      setMenuEnabled(IMPORT_INTO_SEQUENCE_MENU, false);
     }
   }
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 31354)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java	(revision 31355)
@@ -12,7 +12,11 @@
  */
 public class MapillarySequence {
-  private final List<MapillaryImage> images;
-  private final String key;
-  private final long created_at;
+  private final List<MapillaryAbstractImage> images;
+  private String key;
+  private long created_at;
+  
+  public MapillarySequence() {
+    this.images = new ArrayList<>();
+  }
 
   public MapillarySequence(String key, long created_at) {
@@ -27,5 +31,5 @@
    * @return
    */
-  public List<MapillaryImage> getImages() {
+  public List<MapillaryAbstractImage> getImages() {
     return this.images;
   }
@@ -40,5 +44,5 @@
    * @param image
    */
-  public synchronized void add(MapillaryImage image) {
+  public synchronized void add(MapillaryAbstractImage image) {
     this.images.add(image);
   }
@@ -53,6 +57,6 @@
    * @param images
    */
-  public synchronized void add(List<MapillaryImage> images) {
-    for (MapillaryImage image : images)
+  public synchronized void add(List<MapillaryAbstractImage> images) {
+    for (MapillaryAbstractImage image : images)
       add(image);
   }
@@ -63,5 +67,5 @@
    * @param image
    */
-  public void remove(MapillaryImage image) {
+  public void remove(MapillaryAbstractImage image) {
     this.images.remove(image);
   }
@@ -73,5 +77,5 @@
    * @return
    */
-  public MapillaryImage next(MapillaryImage image) {
+  public MapillaryAbstractImage next(MapillaryAbstractImage image) {
     if (!images.contains(image))
       throw new IllegalArgumentException();
@@ -84,10 +88,10 @@
 
   /**
-   * Returns the previous MapillaryImage in the sequence.
+   * Returns the previous {@link MapillaryAbstractImage} in the sequence.
    * 
    * @param image
    * @return
    */
-  public MapillaryImage previous(MapillaryImage image) {
+  public MapillaryAbstractImage previous(MapillaryAbstractImage image) {
     if (!images.contains(image))
       throw new IllegalArgumentException();
@@ -100,6 +104,6 @@
 
   /**
-   * Returns the difference of index between two MapillaryImage objects
-   * belonging to the same MapillarySequence.
+   * Returns the difference of index between two {@link MapillaryAbstractImage}
+   * objects belonging to the same {@link MapillarySequence}.
    * 
    * @param image1
@@ -107,20 +111,8 @@
    * @return
    */
-  public int getDistance(MapillaryImage image1, MapillaryImage image2) {
+  public int getDistance(MapillaryAbstractImage image1, MapillaryAbstractImage image2) {
     if (!this.images.contains(image1) || !this.images.contains(image2))
       throw new IllegalArgumentException();
     return Math.abs(this.images.indexOf(image1) - this.images.indexOf(image2));
   }
-
-  @Override
-  public boolean equals(Object obj) {
-    if (obj instanceof MapillarySequence)
-      return this.getKey().equals(((MapillarySequence) obj).getKey());
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    return this.key.hashCode();
-  }
 }
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java	(revision 31354)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java	(revision 31355)
@@ -44,8 +44,7 @@
 
   public MapillaryImportAction() {
-    super(tr("Import pictures"), new ImageProvider("icon24.png"),
-        tr("Import local pictures"), Shortcut.registerShortcut("Import Mapillary",
-            tr("Import pictures into Mapillary layer"), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE),
-        false, "mapillaryImport", false);
+    super(tr("Import pictures"), new ImageProvider("icon24.png"), tr("Import local pictures"), Shortcut
+        .registerShortcut("Import Mapillary", tr("Import pictures into Mapillary layer"), KeyEvent.CHAR_UNDEFINED,
+            Shortcut.NONE), false, "mapillaryImport", false);
     this.setEnabled(false);
   }
@@ -63,6 +62,7 @@
       for (int i = 0; i < chooser.getSelectedFiles().length; i++) {
         File file = chooser.getSelectedFiles()[i];
-        if (!file.isDirectory()) {
-          MapillaryLayer.getInstance();
+        if (file.isDirectory()) {
+          // TODO import directory
+        } else {
           if (file.getPath().substring(file.getPath().length() - 4).equals(".jpg")
               || file.getPath().substring(file.getPath().length() - 5).equals(".jpeg")) {
@@ -108,13 +108,17 @@
       double lonValue = 0;
       double caValue = 0;
-      if (lat.getValue() instanceof RationalNumber[])
-        latValue = degMinSecToDouble((RationalNumber[]) lat.getValue(), lat_ref.getValue().toString());
-      if (lon.getValue() instanceof RationalNumber[])
-        lonValue = degMinSecToDouble((RationalNumber[]) lon.getValue(), lon_ref.getValue().toString());
+      if (lat != null && lat.getValue() instanceof RationalNumber[])
+        latValue = DegMinSecToDouble((RationalNumber[]) lat.getValue(), lat_ref.getValue().toString());
+      if (lon != null && lon.getValue() instanceof RationalNumber[])
+        lonValue = DegMinSecToDouble((RationalNumber[]) lon.getValue(), lon_ref.getValue().toString());
       if (ca != null && ca.getValue() instanceof RationalNumber)
         caValue = ((RationalNumber) ca.getValue()).doubleValue();
+      if (lat_ref.getValue().toString().equals("S"))
+        latValue = -latValue;
+      if (lon_ref.getValue().toString().equals("W"))
+        lonValue = -lonValue;
       if (datetimeOriginal != null)
-        MapillaryData.getInstance()
-            .add(new MapillaryImportedImage(latValue, lonValue, caValue, file, datetimeOriginal.getStringValue()));
+        MapillaryData.getInstance().add(
+            new MapillaryImportedImage(latValue, lonValue, caValue, file, datetimeOriginal.getStringValue()));
       else
         MapillaryData.getInstance().add(new MapillaryImportedImage(latValue, lonValue, caValue, file));
@@ -144,42 +148,9 @@
   }
 
-  /**
-   * Calculates the decimal degree-value from a degree value given in degrees-minutes-seconds-format
-   *
-   * @param degMinSec an array of length 3, the values in there are (in this order) degrees, minutes and seconds
-   * @param ref the latitude or longitude reference determining if the given value is:
-   *        <ul>
-   *        <li>north ({@link GpsTagConstants#GPS_TAG_GPS_LATITUDE_REF_VALUE_NORTH}) or
-   *        south ({@link GpsTagConstants#GPS_TAG_GPS_LATITUDE_REF_VALUE_SOUTH}) of the equator</li>
-   *        <li>east ({@link GpsTagConstants#GPS_TAG_GPS_LONGITUDE_REF_VALUE_EAST}) or
-   *        west ({@link GpsTagConstants#GPS_TAG_GPS_LONGITUDE_REF_VALUE_WEST}) of the equator</li>
-   *        </ul>
-   * @return the decimal degree-value for the given input, negative when west of 0-meridian or south of equator,
-   *         positive otherwise
-   * @throws IllegalArgumentException if {@code degMinSec} doesn't have length 3 or if {@code ref} is not one of the
-   *         values mentioned above
-   */
-  private static double degMinSecToDouble(RationalNumber[] degMinSec, String ref) {
-    if (degMinSec == null || degMinSec.length != 3) { throw new IllegalArgumentException(); }
-    switch (ref) {
-    case GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_NORTH:
-    case GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_SOUTH:
-    case GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_EAST:
-    case GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_WEST:
-      break;
-    default:
-      throw new IllegalArgumentException();
-    }
-
-    double result = degMinSec[0].doubleValue(); // degrees
-    result += degMinSec[1].doubleValue() / 60; // minutes
-    result += degMinSec[2].doubleValue() / 3600; // seconds
-
-    if (ref == GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_SOUTH
-        || ref == GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_WEST) {
-      result *= -1;
-    }
-
-    return result;
+  public static double DegMinSecToDouble(RationalNumber[] degMinSec, String ref) {
+    RationalNumber deg = degMinSec[0];
+    RationalNumber min = degMinSec[1];
+    RationalNumber sec = degMinSec[2];
+    return deg.doubleValue() + min.doubleValue() / 60 + sec.doubleValue() / 3600;
   }
 }
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 31355)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java	(revision 31355)
@@ -0,0 +1,149 @@
+package org.openstreetmap.josm.plugins.mapillary.actions;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.LinkedList;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileNameExtensionFilter;
+
+import org.apache.commons.imaging.ImageReadException;
+import org.apache.commons.imaging.Imaging;
+import org.apache.commons.imaging.common.ImageMetadata;
+import org.apache.commons.imaging.common.RationalNumber;
+import org.apache.commons.imaging.formats.jpeg.JpegImageMetadata;
+import org.apache.commons.imaging.formats.tiff.TiffField;
+import org.apache.commons.imaging.formats.tiff.constants.ExifTagConstants;
+import org.apache.commons.imaging.formats.tiff.constants.GpsTagConstants;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryData;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
+import org.openstreetmap.josm.plugins.mapillary.MapillarySequence;
+import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.Shortcut;
+
+public class MapillaryImportIntoSequenceAction extends JosmAction {
+
+  public JFileChooser chooser;
+
+  private LinkedList<MapillaryImportedImage> images;
+
+  public MapillaryImportIntoSequenceAction() {
+    super(tr("Import pictures into sequence"), new ImageProvider("icon24.png"), tr("Import local pictures"), Shortcut
+        .registerShortcut("Import Mapillary Sequence", tr("Import pictures into Mapillary layer in a sequence"),
+            KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), false, "mapillaryImportSequence", false);
+    this.setEnabled(false);
+  }
+
+  @Override
+  public void actionPerformed(ActionEvent arg0) {
+    images = new LinkedList<>();
+
+    chooser = new JFileChooser();
+    chooser.setCurrentDirectory(new java.io.File(System.getProperty("user.home")));
+    chooser.setDialogTitle(tr("Select pictures"));
+    chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
+    chooser.setAcceptAllFileFilterUsed(false);
+    chooser.addChoosableFileFilter(new FileNameExtensionFilter("images", "jpg", "jpeg"));
+    chooser.setMultiSelectionEnabled(true);
+    if (chooser.showOpenDialog(Main.parent) == JFileChooser.APPROVE_OPTION) {
+      for (int i = 0; i < chooser.getSelectedFiles().length; i++) {
+        File file = chooser.getSelectedFiles()[i];
+        if (file.isDirectory()) {
+          // TODO import directory
+        } else {
+          MapillaryLayer.getInstance();
+          if (file.getPath().substring(file.getPath().length() - 4).equals(".jpg")
+              || file.getPath().substring(file.getPath().length() - 5).equals(".jpeg")) {
+            try {
+              readJPG(file);
+            } catch (ImageReadException ex) {
+              Main.error(ex);
+            } catch (IOException ex) {
+              Main.error(ex);
+            }
+          }
+        }
+      }
+      joinImages();
+    }
+  }
+
+  /**
+   * Reads a jpg pictures that contains the needed GPS information (position and
+   * direction) and creates a new icon in that position.
+   *
+   * @param file
+   * @throws ImageReadException
+   * @throws IOException
+   */
+  public void readJPG(File file) throws ImageReadException, IOException {
+    final ImageMetadata metadata = Imaging.getMetadata(file);
+    if (metadata instanceof JpegImageMetadata) {
+      final JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
+      final TiffField lat_ref = jpegMetadata.findEXIFValueWithExactMatch(GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF);
+      final TiffField lat = jpegMetadata.findEXIFValueWithExactMatch(GpsTagConstants.GPS_TAG_GPS_LATITUDE);
+      final TiffField lon_ref = jpegMetadata.findEXIFValueWithExactMatch(GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF);
+      final TiffField lon = jpegMetadata.findEXIFValueWithExactMatch(GpsTagConstants.GPS_TAG_GPS_LONGITUDE);
+      final TiffField ca = jpegMetadata.findEXIFValueWithExactMatch(GpsTagConstants.GPS_TAG_GPS_IMG_DIRECTION);
+      final TiffField datetimeOriginal = jpegMetadata
+          .findEXIFValueWithExactMatch(ExifTagConstants.EXIF_TAG_DATE_TIME_ORIGINAL);
+      if (lat_ref == null || lat == null || lon == null || lon_ref == null || datetimeOriginal == null)
+        throw new IllegalArgumentException("The picture has not correct EXIF tags");
+
+      double latValue = 0;
+      double lonValue = 0;
+      double caValue = 0;
+      if (lat != null && lat.getValue() instanceof RationalNumber[])
+        latValue = MapillaryImportAction.DegMinSecToDouble((RationalNumber[]) lat.getValue(), lat_ref.getValue()
+            .toString());
+      if (lon != null && lon.getValue() instanceof RationalNumber[])
+        lonValue = MapillaryImportAction.DegMinSecToDouble((RationalNumber[]) lon.getValue(), lon_ref.getValue()
+            .toString());
+      if (ca != null && ca.getValue() instanceof RationalNumber)
+        caValue = ((RationalNumber) ca.getValue()).doubleValue();
+      if (lat_ref.getValue().toString().equals("S"))
+        latValue = -latValue;
+      if (lon_ref.getValue().toString().equals("W"))
+        lonValue = -lonValue;
+
+      MapillaryImportedImage image = new MapillaryImportedImage(latValue, lonValue, caValue, file,
+          datetimeOriginal.getStringValue());
+      MapillaryData.getInstance().add(image);
+      image.getCapturedAt();
+
+      images.add(image);
+    }
+  }
+
+  public void joinImages() {
+    Collections.sort(images, new MapillaryEpochComparator());
+    MapillarySequence seq = new MapillarySequence();
+    for (MapillaryImportedImage img : images) {
+      seq.add(img);
+      img.setSequence(seq);
+    }
+  }
+
+  public class MapillaryEpochComparator implements Comparator<MapillaryAbstractImage> {
+
+    @Override
+    public int compare(MapillaryAbstractImage arg0, MapillaryAbstractImage arg1) {
+      if (arg0.getCapturedAt() < arg1.getCapturedAt())
+        return -1;
+      if (arg0.getCapturedAt() > arg1.getCapturedAt())
+        return 1;
+      else
+        return 0;
+    }
+  }
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java	(revision 31354)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java	(revision 31355)
@@ -145,5 +145,5 @@
         this.previousButton.setEnabled(false);
         if (((MapillaryImage) image).getSequence() != null) {
-          MapillaryImage tempImage = (MapillaryImage) image;
+          MapillaryAbstractImage tempImage = image;
           while (tempImage.next() != null) {
             tempImage = tempImage.next();
@@ -155,5 +155,5 @@
         }
         if (((MapillaryImage) image).getSequence() != null) {
-          MapillaryImage tempImage = (MapillaryImage) image;
+          MapillaryAbstractImage tempImage = image;
           while (tempImage.previous() != null) {
             tempImage = tempImage.previous();
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryOAuthUI.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryOAuthUI.java	(revision 31354)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryOAuthUI.java	(revision 31355)
@@ -39,4 +39,5 @@
     in.close();
     System.out.println();
+    in.close();
   }
 
