Index: applications/editors/josm/plugins/mapillary/.classpath
===================================================================
--- applications/editors/josm/plugins/mapillary/.classpath	(revision 31310)
+++ applications/editors/josm/plugins/mapillary/.classpath	(revision 31311)
@@ -2,8 +2,10 @@
 <classpath>
 	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="test/unit"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry combineaccessrules="false" exported="true" kind="src" path="/JOSM-commons-imaging"/>
 	<classpathentry exported="true" kind="lib" path="/home/nokutu/josm/dist/commons-imaging.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
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 31310)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java	(revision 31311)
@@ -1,5 +1,5 @@
 package org.openstreetmap.josm.plugins.mapillary;
 
-import java.sql.Date;
+import java.util.Date;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -11,5 +11,5 @@
 
 /**
- * Abstract supperclass for all image objects. At the moment there is just 2,
+ * Abstract superclass for all image objects. At the moment there is just 2,
  * {@code MapillaryImportedImage} and {@code MapillaryImage}.
  * 
@@ -21,5 +21,5 @@
     private long capturedAt;
 
-    /** Postion of the picture */
+    /** Position of the picture */
     public final LatLon latLon;
     /** Direction of the picture */
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 31310)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31311)
@@ -20,308 +20,313 @@
  */
 public class MapillaryData implements ICachedLoaderListener {
-    public volatile static MapillaryData INSTANCE;
-
-    private final List<MapillaryAbstractImage> images;
-    private MapillaryAbstractImage selectedImage;
-    private MapillaryAbstractImage hoveredImage;
-    private final List<MapillaryAbstractImage> multiSelectedImages;
-
-    private List<MapillaryDataListener> listeners = new ArrayList<>();
-
-    public MapillaryData() {
-        images = new CopyOnWriteArrayList<>();
-        multiSelectedImages = new ArrayList<>();
-        selectedImage = null;
-    }
-
-    public static MapillaryData getInstance() {
-        if (INSTANCE == null) {
-            INSTANCE = new MapillaryData();
-        }
-        return INSTANCE;
-    }
-
-    /**
-     * Adds a set of MapillaryImages to the object, and then repaints mapView.
-     * 
-     * @param images
-     *            The set of images to be added.
-     */
-    public synchronized void add(List<MapillaryAbstractImage> images) {
-        for (MapillaryAbstractImage image : images) {
-            add(image);
-        }
-    }
-
-    /**
-     * Adds an MapillaryImage to the object, and then repaints mapView.
-     * 
-     * @param image
-     *            The image to be added.
-     */
-    public synchronized void add(MapillaryAbstractImage image) {
-        if (!images.contains(image)) {
-            this.images.add(image);
-        }
-        dataUpdated();
-        fireImagesAdded();
-    }
-
-    public void addListener(MapillaryDataListener lis) {
-        listeners.add(lis);
-    }
-
-    public void removeListener(MapillaryDataListener lis) {
-        listeners.remove(lis);
-    }
-
-    /**
-     * Adds a set of MapillaryImages to the object, but doesn't repaint mapView.
-     * This is needed for concurrency.
-     * 
-     * @param images
-     *            The set of images to be added.
-     */
-    public synchronized void addWithoutUpdate(
-            List<MapillaryAbstractImage> images) {
-        for (MapillaryAbstractImage image : images) {
-            addWithoutUpdate(image);
-        }
-    }
-
-    /**
-     * Sets the image under the mouse cursor.
-     * 
-     * @param image
-     */
-    public void setHoveredImage(MapillaryAbstractImage image) {
-        hoveredImage = image;
-    }
-
-    /**
-     * Returns the image under the mouse cursor.
-     * 
-     * @return
-     */
-    public MapillaryAbstractImage getHoveredImage() {
-        return hoveredImage;
-    }
-
-    /**
-     * Adds a MapillaryImage to the object, but doesn't repaint mapView. This is
-     * needed for concurrency.
-     * 
-     * @param image
-     *            The image to be added.
-     */
-    public synchronized void addWithoutUpdate(MapillaryAbstractImage image) {
-        if (!images.contains(image)) {
-            this.images.add(image);
-        }
-        fireImagesAdded();
-    }
-
-    /**
-     * Repaints mapView object.
-     */
-    public synchronized void dataUpdated() {
-        Main.map.mapView.repaint();
-    }
-
-    /**
-     * Returns a List containing all images.
-     * 
-     * @return A List object containing all images.
-     */
-    public List<MapillaryAbstractImage> getImages() {
-        return images;
-    }
-
-    /**
-     * Returns the MapillaryImage object that is currently selected.
-     * 
-     * @return The selected MapillaryImage object.
-     */
-    public MapillaryAbstractImage getSelectedImage() {
-        return selectedImage;
-    }
-
-    private void fireImagesAdded() {
-        if (listeners.isEmpty())
-            return;
-        for (MapillaryDataListener lis : listeners)
-            lis.imagesAdded();
-    }
-
-    /**
-     * If the selected MapillaryImage is part of a MapillarySequence then the
-     * following visible MapillaryImage is selected. In case there is none, does
-     * nothing.
-     */
-    public void selectNext() {
-        if (getSelectedImage() instanceof MapillaryImage) {
-            if (getSelectedImage() == null)
-                return;
-            if (((MapillaryImage) getSelectedImage()).getSequence() == null)
-                return;
-            if (selectedImage instanceof MapillaryImage && ((MapillaryImage) selectedImage).getSequence() != null) {
+	public volatile static MapillaryData INSTANCE;
+	public static boolean TEST_MODE = false;
+
+	private final List<MapillaryAbstractImage> images;
+	private MapillaryAbstractImage selectedImage;
+	private MapillaryAbstractImage hoveredImage;
+	private final List<MapillaryAbstractImage> multiSelectedImages;
+
+	private List<MapillaryDataListener> listeners = new ArrayList<>();
+
+	public MapillaryData() {
+		images = new CopyOnWriteArrayList<>();
+		multiSelectedImages = new ArrayList<>();
+		selectedImage = null;
+	}
+
+	public static MapillaryData getInstance() {
+		if (INSTANCE == null) {
+			INSTANCE = new MapillaryData();
+		}
+		return INSTANCE;
+	}
+
+	/**
+	 * Adds a set of MapillaryImages to the object, and then repaints mapView.
+	 * 
+	 * @param images
+	 *            The set of images to be added.
+	 */
+	public synchronized void add(List<MapillaryAbstractImage> images) {
+		for (MapillaryAbstractImage image : images) {
+			add(image);
+		}
+	}
+
+	/**
+	 * Adds an MapillaryImage to the object, and then repaints mapView.
+	 * 
+	 * @param image
+	 *            The image to be added.
+	 */
+	public synchronized void add(MapillaryAbstractImage image) {
+		if (!images.contains(image)) {
+			this.images.add(image);
+		}
+		dataUpdated();
+		fireImagesAdded();
+	}
+
+	public void addListener(MapillaryDataListener lis) {
+		listeners.add(lis);
+	}
+
+	public void removeListener(MapillaryDataListener lis) {
+		listeners.remove(lis);
+	}
+
+	/**
+	 * Adds a set of MapillaryImages to the object, but doesn't repaint mapView.
+	 * This is needed for concurrency.
+	 * 
+	 * @param images
+	 *            The set of images to be added.
+	 */
+	public synchronized void addWithoutUpdate(
+			List<MapillaryAbstractImage> images) {
+		for (MapillaryAbstractImage image : images) {
+			addWithoutUpdate(image);
+		}
+	}
+
+	/**
+	 * Sets the image under the mouse cursor.
+	 * 
+	 * @param image
+	 */
+	public void setHoveredImage(MapillaryAbstractImage image) {
+		hoveredImage = image;
+	}
+
+	/**
+	 * Returns the image under the mouse cursor.
+	 * 
+	 * @return
+	 */
+	public MapillaryAbstractImage getHoveredImage() {
+		return hoveredImage;
+	}
+
+	/**
+	 * Adds a MapillaryImage to the object, but doesn't repaint mapView. This is
+	 * needed for concurrency.
+	 * 
+	 * @param image
+	 *            The image to be added.
+	 */
+	public synchronized void addWithoutUpdate(MapillaryAbstractImage image) {
+		if (!images.contains(image)) {
+			this.images.add(image);
+		}
+		fireImagesAdded();
+	}
+
+	/**
+	 * Repaints mapView object.
+	 */
+	public synchronized void dataUpdated() {
+		if (!TEST_MODE)
+			Main.map.mapView.repaint();
+	}
+
+	/**
+	 * Returns a List containing all images.
+	 * 
+	 * @return A List object containing all images.
+	 */
+	public List<MapillaryAbstractImage> getImages() {
+		return images;
+	}
+
+	/**
+	 * Returns the MapillaryImage object that is currently selected.
+	 * 
+	 * @return The selected MapillaryImage object.
+	 */
+	public MapillaryAbstractImage getSelectedImage() {
+		return selectedImage;
+	}
+
+	private void fireImagesAdded() {
+		if (listeners.isEmpty())
+			return;
+		for (MapillaryDataListener lis : listeners)
+			lis.imagesAdded();
+	}
+
+	/**
+	 * If the selected MapillaryImage is part of a MapillarySequence then the
+	 * following visible MapillaryImage is selected. In case there is none, does
+	 * nothing.
+	 */
+	public void selectNext() {
+		if (getSelectedImage() instanceof MapillaryImage) {
+			if (getSelectedImage() == null)
+				return;
+			if (((MapillaryImage) getSelectedImage()).getSequence() == null)
+				return;
+			if (selectedImage instanceof MapillaryImage
+					&& ((MapillaryImage) selectedImage).getSequence() != null) {
 				MapillaryImage tempImage = (MapillaryImage) selectedImage;
 				while (tempImage.next() != null) {
 					tempImage = tempImage.next();
 					if (tempImage.isVisible()) {
-			            setSelectedImage(tempImage, true);
+						setSelectedImage(tempImage, true);
 						break;
 					}
 				}
 			}
-        }
-    }
-
-    /**
-     * If the selected MapillaryImage is part of a MapillarySequence then the
-     * previous visible MapillaryImage is selected. In case there is none, does nothing.
-     */
-    public void selectPrevious() {
-        if (getSelectedImage() instanceof MapillaryImage) {
-            if (getSelectedImage() == null)
-                return;
-            if (((MapillaryImage) getSelectedImage()).getSequence() == null)
-                throw new IllegalStateException();
-            if (selectedImage instanceof MapillaryImage && ((MapillaryImage) selectedImage).getSequence() != null) {
+		}
+	}
+
+	/**
+	 * If the selected MapillaryImage is part of a MapillarySequence then the
+	 * previous visible MapillaryImage is selected. In case there is none, does
+	 * nothing.
+	 */
+	public void selectPrevious() {
+		if (getSelectedImage() instanceof MapillaryImage) {
+			if (getSelectedImage() == null)
+				return;
+			if (((MapillaryImage) getSelectedImage()).getSequence() == null)
+				throw new IllegalStateException();
+			if (selectedImage instanceof MapillaryImage
+					&& ((MapillaryImage) selectedImage).getSequence() != null) {
 				MapillaryImage tempImage = (MapillaryImage) selectedImage;
 				while (tempImage.previous() != null) {
 					tempImage = tempImage.previous();
 					if (tempImage.isVisible()) {
-			            setSelectedImage(tempImage, true);
+						setSelectedImage(tempImage, true);
 						break;
 					}
 				}
 			}
-        }
-    }
-
-    /**
-     * Selects a new image and then starts a new MapillaryImageDownloadThread
-     * thread in order to download its surrounding thumbnails. If the user does
-     * ctrl+click, this isn't triggered.
-     * 
-     * @param image
-     *            The MapillaryImage which is going to be selected
-     */
-    public void setSelectedImage(MapillaryAbstractImage image) {
-        setSelectedImage(image, false);
-    }
-
-    /**
-     * Selects a new image and then starts a new MapillaryImageDownloadThread
-     * thread in order to download its surrounding thumbnails. If the user does
-     * ctrl+click, this isn't triggered. You can choose wheter to center the
-     * view on the new image or not.
-     * 
-     * @param image
-     * @param zoom
-     */
-    public void setSelectedImage(MapillaryAbstractImage image, boolean zoom) {
-        MapillaryAbstractImage oldImage = selectedImage;
-        selectedImage = image;
-        multiSelectedImages.clear();
-        multiSelectedImages.add(image);
-        if (image != null) {
-            if (image instanceof MapillaryImage) {
-                MapillaryImage mapillaryImage = (MapillaryImage) image;
-                if (mapillaryImage.next() != null) {
-                    new MapillaryCache(mapillaryImage.next().getKey(),
-                            MapillaryCache.Type.THUMBNAIL).submit(this, false);
-                    if (mapillaryImage.next().next() != null)
-                        new MapillaryCache(mapillaryImage.next().next()
-                                .getKey(), MapillaryCache.Type.THUMBNAIL)
-                                .submit(this, false);
-                }
-                if (mapillaryImage.previous() != null) {
-                    new MapillaryCache(mapillaryImage.previous().getKey(),
-                            MapillaryCache.Type.THUMBNAIL).submit(this, false);
-                    if (mapillaryImage.previous().previous() != null)
-                        new MapillaryCache(mapillaryImage.previous().previous()
-                                .getKey(), MapillaryCache.Type.THUMBNAIL)
-                                .submit(this, false);
-                }
-            }
-        }
-        if (zoom)
-            Main.map.mapView.zoomTo(MapillaryData.getInstance()
-                    .getSelectedImage().getLatLon());
-        if (Main.map != null)
-            Main.map.mapView.repaint();
-        fireSelectedImageChanged(oldImage, selectedImage);
-    }
-
-    private void fireSelectedImageChanged(MapillaryAbstractImage oldImage,
-            MapillaryAbstractImage newImage) {
-        if (listeners.isEmpty())
-            return;
-        for (MapillaryDataListener lis : listeners)
-            lis.selectedImageChanged(oldImage, newImage);
-    }
-
-    /**
-     * Adds a MapillaryImage object to the list of selected images, (when ctrl +
-     * click)
-     * 
-     * @param image
-     *            The MapillaryImage object to be added.
-     */
-    public void addMultiSelectedImage(MapillaryAbstractImage image) {
-        if (!this.multiSelectedImages.contains(image)) {
-            if (this.getSelectedImage() != null)
-                this.multiSelectedImages.add(image);
-            else
-                this.setSelectedImage(image);
-        }
-        Main.map.mapView.repaint();
-    }
-
-    /**
-     * Adds a set of MapillaryImage objects to the list of selected images.
-     * 
-     * @param images
-     */
-    public void addMultiSelectedImage(List<MapillaryAbstractImage> images) {
-        for (MapillaryAbstractImage image : images)
-            if (!this.multiSelectedImages.contains(image)) {
-                if (this.getSelectedImage() != null)
-                    this.multiSelectedImages.add(image);
-                else
-                    this.setSelectedImage(image);
-            }
-        Main.map.mapView.repaint();
-    }
-
-    /**
-     * Returns a list containing all MapillaryImage objects selected with ctrl +
-     * click
-     * 
-     * @return
-     */
-    public List<MapillaryAbstractImage> getMultiSelectedImages() {
-        return multiSelectedImages;
-    }
-
-    /**
-     * This is empty because it is used just to make sure that certain images
-     * have already been downloaded.
-     */
-    @Override
-    public void loadingFinished(CacheEntry data,
-            CacheEntryAttributes attributes, LoadResult result) {
-        // DO NOTHING
-    }
-
-    /**
-     * Returns the amount of images contained by this object.
-     * 
-     * @return
-     */
-    public int size() {
-        return images.size();
-    }
+		}
+	}
+
+	/**
+	 * Selects a new image and then starts a new MapillaryImageDownloadThread
+	 * thread in order to download its surrounding thumbnails. If the user does
+	 * ctrl+click, this isn't triggered.
+	 * 
+	 * @param image
+	 *            The MapillaryImage which is going to be selected
+	 */
+	public void setSelectedImage(MapillaryAbstractImage image) {
+		setSelectedImage(image, false);
+	}
+
+	/**
+	 * Selects a new image and then starts a new MapillaryImageDownloadThread
+	 * thread in order to download its surrounding thumbnails. If the user does
+	 * ctrl+click, this isn't triggered. You can choose wheter to center the
+	 * view on the new image or not.
+	 * 
+	 * @param image
+	 * @param zoom
+	 */
+	public void setSelectedImage(MapillaryAbstractImage image, boolean zoom) {
+		MapillaryAbstractImage oldImage = selectedImage;
+		selectedImage = image;
+		multiSelectedImages.clear();
+		multiSelectedImages.add(image);
+		if (image != null) {
+			if (image instanceof MapillaryImage) {
+				MapillaryImage mapillaryImage = (MapillaryImage) image;
+				if (mapillaryImage.next() != null) {
+					new MapillaryCache(mapillaryImage.next().getKey(),
+							MapillaryCache.Type.THUMBNAIL).submit(this, false);
+					if (mapillaryImage.next().next() != null)
+						new MapillaryCache(mapillaryImage.next().next()
+								.getKey(), MapillaryCache.Type.THUMBNAIL)
+								.submit(this, false);
+				}
+				if (mapillaryImage.previous() != null) {
+					new MapillaryCache(mapillaryImage.previous().getKey(),
+							MapillaryCache.Type.THUMBNAIL).submit(this, false);
+					if (mapillaryImage.previous().previous() != null)
+						new MapillaryCache(mapillaryImage.previous().previous()
+								.getKey(), MapillaryCache.Type.THUMBNAIL)
+								.submit(this, false);
+				}
+			}
+		}
+		if (zoom)
+			Main.map.mapView.zoomTo(MapillaryData.getInstance()
+					.getSelectedImage().getLatLon());
+		if (Main.map != null)
+			Main.map.mapView.repaint();
+		fireSelectedImageChanged(oldImage, selectedImage);
+	}
+
+	private void fireSelectedImageChanged(MapillaryAbstractImage oldImage,
+			MapillaryAbstractImage newImage) {
+		if (listeners.isEmpty())
+			return;
+		for (MapillaryDataListener lis : listeners)
+			lis.selectedImageChanged(oldImage, newImage);
+	}
+
+	/**
+	 * Adds a MapillaryImage object to the list of selected images, (when ctrl +
+	 * click)
+	 * 
+	 * @param image
+	 *            The MapillaryImage object to be added.
+	 */
+	public void addMultiSelectedImage(MapillaryAbstractImage image) {
+		if (!this.multiSelectedImages.contains(image)) {
+			if (this.getSelectedImage() != null)
+				this.multiSelectedImages.add(image);
+			else
+				this.setSelectedImage(image);
+		}
+		Main.map.mapView.repaint();
+	}
+
+	/**
+	 * Adds a set of MapillaryImage objects to the list of selected images.
+	 * 
+	 * @param images
+	 */
+	public void addMultiSelectedImage(List<MapillaryAbstractImage> images) {
+		for (MapillaryAbstractImage image : images)
+			if (!this.multiSelectedImages.contains(image)) {
+				if (this.getSelectedImage() != null)
+					this.multiSelectedImages.add(image);
+				else
+					this.setSelectedImage(image);
+			}
+		Main.map.mapView.repaint();
+	}
+
+	/**
+	 * Returns a list containing all MapillaryImage objects selected with ctrl +
+	 * click
+	 * 
+	 * @return
+	 */
+	public List<MapillaryAbstractImage> getMultiSelectedImages() {
+		return multiSelectedImages;
+	}
+
+	/**
+	 * This is empty because it is used just to make sure that certain images
+	 * have already been downloaded.
+	 */
+	@Override
+	public void loadingFinished(CacheEntry data,
+			CacheEntryAttributes attributes, LoadResult result) {
+		// DO NOTHING
+	}
+
+	/**
+	 * Returns the amount of images contained by this object.
+	 * 
+	 * @return
+	 */
+	public int size() {
+		return images.size();
+	}
 }
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 31310)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImportedImage.java	(revision 31311)
@@ -4,4 +4,6 @@
 import java.io.File;
 import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
 
 import javax.imageio.ImageIO;
@@ -14,4 +16,8 @@
     protected File file;
     public final long datetimeOriginal;
+    
+    public MapillaryImportedImage(double lat, double lon, double ca, File file) {
+    	this(lat, lon, ca, file, currentDate());
+    }
 
     public MapillaryImportedImage(double lat, double lon, double ca, File file,
@@ -47,3 +53,11 @@
         return this.file.hashCode();
     }
+    
+    private static String currentDate() {
+        Calendar cal = Calendar.getInstance();
+
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");
+        return formatter.format(cal.getTime());
+
+    }
 }
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 31310)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31311)
@@ -110,5 +110,5 @@
 		Main.map.mapView.setActiveLayer(this);
 		createHatchTexture();
-		Main.map.repaint();
+		data.dataUpdated();
 	}
 
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 31310)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java	(revision 31311)
@@ -7,6 +7,4 @@
 import java.io.File;
 import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
 
 import javax.swing.JFileChooser;
@@ -38,154 +36,146 @@
 public class MapillaryImportAction extends JosmAction {
 
-    public JFileChooser chooser;
+	public JFileChooser chooser;
 
-    /**
-     * Amount of pictures without the proper EXIF tags.
-     */
-    private int noTagsPics = 0;
+	/**
+	 * Amount of pictures without the proper EXIF tags.
+	 */
+	private int noTagsPics = 0;
 
-    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.VK_M, Shortcut.NONE), false,
-                "mapillaryImport", false);
-        this.setEnabled(false);
-    }
+	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.VK_M, Shortcut.NONE), false,
+				"mapillaryImport", false);
+		this.setEnabled(false);
+	}
 
-    @Override
-    public void actionPerformed(ActionEvent e) {
-        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", "png"));
-        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()) {
+	@Override
+	public void actionPerformed(ActionEvent e) {
+		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", "png"));
+		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()) {
 
-                } else {
-                    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);
-                        }
-                    } else if (file.getPath()
-                            .substring(file.getPath().length() - 4)
-                            .equals(".png")) {
-                        readPNG(file);
-                    }
-                }
-            }
-        }
-        MapillaryLayer.getInstance();
-    }
+				} else {
+					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);
+						}
+					} else if (file.getPath()
+							.substring(file.getPath().length() - 4)
+							.equals(".png")) {
+						readPNG(file);
+					}
+				}
+			}
+		}
+		MapillaryLayer.getInstance();
+	}
 
-    /**
-     * 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) {
-                readNoTags(file);
-            }
-            double latValue = 0;
-            double lonValue = 0;
-            double caValue = 0;
-            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()));
-            else
-                MapillaryData.getInstance().add(
-                        new MapillaryImportedImage(latValue, lonValue, caValue,
-                                file, currentDate()));
-        }
-    }
+	/**
+	 * 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) {
+				readNoTags(file);
+			}
+			double latValue = 0;
+			double lonValue = 0;
+			double caValue = 0;
+			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()));
+			else
+				MapillaryData.getInstance().add(
+						new MapillaryImportedImage(latValue, lonValue, caValue,
+								file));
+		}
+	}
 
-    /**
-     * Reads a image file that doesn't contain the needed GPS information. And
-     * creates a new icon in the middle of the map.
-     * 
-     * @param file
-     */
-    private void readNoTags(File file) {
-        double HORIZONTAL_DISTANCE = 0.0001;
-        double horDev;
-        if (noTagsPics % 2 == 0)
-            horDev = HORIZONTAL_DISTANCE * noTagsPics / 2;
-        else
-            horDev = -HORIZONTAL_DISTANCE * (noTagsPics + 1) / 2;
-        LatLon pos = Main.map.mapView.getProjection().eastNorth2latlon(
-                Main.map.mapView.getCenter());
-        MapillaryData.getInstance().add(
-                new MapillaryImportedImage(pos.lat(), pos.lon() + horDev, 0,
-                        file, currentDate()));
-        noTagsPics++;
-    }
+	/**
+	 * Reads a image file that doesn't contain the needed GPS information. And
+	 * creates a new icon in the middle of the map.
+	 * 
+	 * @param file
+	 */
+	private void readNoTags(File file) {
+		double HORIZONTAL_DISTANCE = 0.0001;
+		double horDev;
+		if (noTagsPics % 2 == 0)
+			horDev = HORIZONTAL_DISTANCE * noTagsPics / 2;
+		else
+			horDev = -HORIZONTAL_DISTANCE * (noTagsPics + 1) / 2;
+		LatLon pos = Main.map.mapView.getProjection().eastNorth2latlon(
+				Main.map.mapView.getCenter());
+		MapillaryData.getInstance().add(
+				new MapillaryImportedImage(pos.lat(), pos.lon() + horDev, 0,
+						file));
+		noTagsPics++;
+	}
 
-    private void readPNG(File file) {
-        readNoTags(file);
-    }
+	private void readPNG(File file) {
+		readNoTags(file);
+	}
 
-    private 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;
-    }
-
-    private String currentDate() {
-        Calendar cal = Calendar.getInstance();
-
-        SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");
-        return formatter.format(cal);
-
-    }
+	private 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/gui/MapillaryFilterChooseSigns.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterChooseSigns.java	(revision 31310)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterChooseSigns.java	(revision 31311)
@@ -39,5 +39,5 @@
         JLabel maxspeedLabel = new JLabel(tr("Speed limit"));
         maxspeedLabel.setIcon(new ImageProvider(
-                "styles/standard/vehicle/restriction/speed.png").get());
+                "signs/speed.png").get());
         maxspeedPanel.add(maxspeedLabel);
         maxspeedPanel.add(maxspeed);
@@ -48,5 +48,5 @@
         JLabel stopLabel = new JLabel(tr("Stop"));
         stopLabel.setIcon(new ImageProvider(
-                "styles/standard/vehicle/restriction/stop.png").get());
+                "signs/stop.png").get());
         stopPanel.add(stopLabel);
         stopPanel.add(stop);
@@ -57,5 +57,5 @@
         JLabel giveWayLabel = new JLabel(tr("Give way"));
         giveWayLabel.setIcon(new ImageProvider(
-                "styles/standard/vehicle/restriction/right_of_way.png").get());
+                "signs/right_of_way.png").get());
         giveWayPanel.add(giveWayLabel);
         giveWayPanel.add(giveWay);
@@ -66,5 +66,5 @@
         JLabel roundaboutLabel = new JLabel(tr("Give way"));
         roundaboutLabel.setIcon(new ImageProvider(
-                "styles/standard/vehicle/restriction/roundabout_right.png")
+                "signs/roundabout_right.png")
                 .get());
         roundaboutPanel.add(roundaboutLabel);
@@ -77,5 +77,5 @@
         JLabel noEntryLabel = new JLabel(tr("No entry"));
         noEntryLabel.setIcon(new ImageProvider(
-                "no_entry.png").get());
+                "signs/no_entry.png").get());
         noEntryPanel.add(noEntryLabel);
         noEntryPanel.add(access);
@@ -86,5 +86,5 @@
         JLabel intersectionLabel = new JLabel(tr("Intersection danger"));
         intersectionLabel.setIcon(new ImageProvider(
-                "intersection_danger.png").get());
+                "signs/intersection_danger.png").get());
         intersectionPanel.add(intersectionLabel);
         intersectionPanel.add(intersection);
@@ -95,5 +95,5 @@
         JLabel directionLabel = new JLabel(tr("Mandatory direction (any)"));
         directionLabel.setIcon(new ImageProvider(
-                "/home/nokutu/josm/core/images/styles/standard/vehicle/restriction/turn_restrictions/only_straight_on.png").get());
+                "signs/only_straight_on.png").get());
         directionPanel.add(directionLabel);
         directionPanel.add(direction);
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 31310)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java	(revision 31311)
@@ -50,14 +50,14 @@
 	private final JPanel panel = new JPanel(new GridLayout(ROWS, COLUMNS));
 
-	private final JCheckBox imported = new JCheckBox("Imported images");
-	private final JCheckBox downloaded = new JCheckBox(
+	public final JCheckBox imported = new JCheckBox("Imported images");
+	public final JCheckBox downloaded = new JCheckBox(
 			new downloadCheckBoxAction());
-	private final JCheckBox onlySigns = new JCheckBox(new OnlySignsAction());
-	private final JComboBox<String> time;
-	private final JTextField user;
-
-	private final SideButton updateButton = new SideButton(new UpdateAction());
-	private final SideButton resetButton = new SideButton(new ResetAction());
-	private final JButton signChooser = new JButton(new SignChooserAction());
+	public final JCheckBox onlySigns = new JCheckBox(new OnlySignsAction());
+	public final JComboBox<String> time;
+	public final JTextField user;
+
+	public final SideButton updateButton = new SideButton(new UpdateAction());
+	public final SideButton resetButton = new SideButton(new ResetAction());
+	public final JButton signChooser = new JButton(new SignChooserAction());
 
 	public final MapillaryFilterChooseSigns signFilter = MapillaryFilterChooseSigns
Index: applications/editors/josm/plugins/mapillary/test/README
===================================================================
--- applications/editors/josm/plugins/mapillary/test/README	(revision 31311)
+++ applications/editors/josm/plugins/mapillary/test/README	(revision 31311)
@@ -0,0 +1,9 @@
+
+This directory includes the test resources for the turnrestictions plugin.
+
+
+unit/            test sources (Unit tests, functional tests)
+
+config/          configuration files for running tests
+
+data/            test data
Index: applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportTest.java
===================================================================
--- applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportTest.java	(revision 31311)
+++ applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportTest.java	(revision 31311)
@@ -0,0 +1,15 @@
+package org.openstreetmap.josm.plugins.mapillary;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class ImportTest {
+
+	@Test
+	public void test() {
+		MapillaryImportedImage img = new MapillaryImportedImage(0,0,0, null);
+		assert(true);
+	}
+
+}
