Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryToggleDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryToggleDialog.java	(revision 31178)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryToggleDialog.java	(revision 31179)
@@ -106,4 +106,11 @@
 			}
 			if (this.image != null) {
+				this.nextButton.setEnabled(true);
+				this.previousButton.setEnabled(true);
+				if (this.image.next() == null)
+					this.nextButton.setEnabled(false);
+				if (this.image.previous() == null)
+					this.previousButton.setEnabled(false);
+					
 				CacheAccess<String, BufferedImageCacheEntry> prev;
 				try {
@@ -166,6 +173,8 @@
 			if (MapillaryToggleDialog.getInstance().getImage() != null) {
 				MapillaryData.getInstance().selectNext();
-				Main.map.mapView.zoomTo(MapillaryData.getInstance()
-						.getSelectedImage().getLatLon());
+				if (MapillaryData.getInstance()
+						.getSelectedImage() != null)
+					Main.map.mapView.zoomTo(MapillaryData.getInstance()
+							.getSelectedImage().getLatLon());
 			}
 		}
@@ -189,6 +198,8 @@
 			if (MapillaryToggleDialog.getInstance().getImage() != null) {
 				MapillaryData.getInstance().selectPrevious();
-				Main.map.mapView.zoomTo(MapillaryData.getInstance()
-						.getSelectedImage().getLatLon());
+				if (MapillaryData.getInstance()
+						.getSelectedImage() != null)
+					Main.map.mapView.zoomTo(MapillaryData.getInstance()
+							.getSelectedImage().getLatLon());
 			}
 		}
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java	(revision 31178)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java	(revision 31179)
@@ -34,5 +34,6 @@
 	private Bounds bounds;
 
-	public MapillarySequenceDownloadThread(ExecutorService ex, String url, Bounds bounds) {
+	public MapillarySequenceDownloadThread(ExecutorService ex, String url,
+			Bounds bounds) {
 		this.url = url;
 		this.ex = ex;
@@ -51,4 +52,7 @@
 			}
 			JsonArray jsonseq = jsonall.getJsonArray("ss");
+			// At the moment there is a bug with some sequences at Mapillay API,
+			// so if they are worng he use this variable to skip them.
+			boolean isSequenceWrong = false;
 			for (int i = 0; i < jsonseq.size(); i++) {
 				JsonObject jsonobj = jsonseq.getJsonObject(i);
@@ -64,8 +68,13 @@
 										.getJsonNumber(0).doubleValue(), cas
 										.getJsonNumber(j).doubleValue()));
+					} catch (IndexOutOfBoundsException e) {
+						Main.error(e);
+						isSequenceWrong = true;
 					} catch (Exception e) {
 						Main.error(e);
 					}
 				}
+				if (isSequenceWrong)
+					break;
 				MapillarySequence sequence = new MapillarySequence();
 				int first = -1;
