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 31183)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31185)
@@ -1,16 +1,11 @@
 package org.openstreetmap.josm.plugins.mapillary;
 
-import org.apache.commons.jcs.access.CacheAccess;
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
 import org.openstreetmap.josm.data.cache.CacheEntry;
 import org.openstreetmap.josm.data.cache.CacheEntryAttributes;
 import org.openstreetmap.josm.data.cache.ICachedLoaderListener;
-import org.openstreetmap.josm.data.cache.JCSCacheManager;
 import org.openstreetmap.josm.plugins.mapillary.cache.MapillaryCache;
 
-import java.io.IOException;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -147,6 +142,6 @@
 	/**
 	 * 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.
+	 * thread in order to download its surrounding thumbnails. If the user does
+	 * ctrl+click, this isn't triggered.
 	 * 
 	 * @param image
@@ -160,30 +155,21 @@
 			MapillaryToggleDialog.getInstance().setImage(selectedImage);
 			MapillaryToggleDialog.getInstance().updateImage();
-			CacheAccess<String, BufferedImageCacheEntry> prev = null;
-			try {
-				prev = JCSCacheManager.getCache("mapillary");
-			} catch (IOException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
 			if (image.next() != null) {
 				new MapillaryCache(image.next().getKey(),
-						MapillaryCache.Type.THUMBNAIL, prev, 200000, 200000,
-						new HashMap<String, String>()).submit(this, false);
+						MapillaryCache.Type.THUMBNAIL).submit(
+						this, false);
 				if (image.next().next() != null)
 					new MapillaryCache(image.next().next().getKey(),
-							MapillaryCache.Type.THUMBNAIL, prev, 200000,
-							200000, new HashMap<String, String>()).submit(this,
-							false);
+							MapillaryCache.Type.THUMBNAIL)
+							.submit(this, false);
 			}
 			if (image.previous() != null) {
 				new MapillaryCache(image.previous().getKey(),
-						MapillaryCache.Type.THUMBNAIL, prev, 200000, 200000,
-						new HashMap<String, String>()).submit(this, false);
+						MapillaryCache.Type.THUMBNAIL).submit(
+						this, false);
 				if (image.previous().previous() != null)
 					new MapillaryCache(image.previous().previous().getKey(),
-							MapillaryCache.Type.THUMBNAIL, prev, 200000,
-							200000, new HashMap<String, String>()).submit(this,
-							false);
+							MapillaryCache.Type.THUMBNAIL)
+							.submit(this, false);
 			}
 		}
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 31183)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java	(revision 31185)
@@ -1,7 +1,12 @@
 package org.openstreetmap.josm.plugins.mapillary;
+
+import java.io.IOException;
 
 import javax.swing.ImageIcon;
 import javax.swing.JMenuItem;
 
+import org.apache.commons.jcs.access.CacheAccess;
+import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
+import org.openstreetmap.josm.data.cache.JCSCacheManager;
 import org.openstreetmap.josm.gui.MainMenu;
 import org.openstreetmap.josm.Main;
@@ -28,4 +33,6 @@
 			"mapiconselected.png").get();
 	public static final int ICON_SIZE = 24;
+	
+	public static CacheAccess<String, BufferedImageCacheEntry> CACHE;
 
 	private final MapillaryDownloadAction downloadAction;
@@ -48,4 +55,9 @@
 				false, 14);
 		EXPORT_MENU.setEnabled(false);
+		try {
+			CACHE = JCSCacheManager.getCache("mapillary", 10, 10000, this.getPluginDir() + "/cache/");
+		} catch (IOException e) {
+			Main.error(e);
+		}
 	}
 
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 31183)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryToggleDialog.java	(revision 31185)
@@ -11,9 +11,6 @@
 import java.io.IOException;
 import java.util.Arrays;
-import java.util.HashMap;
-
-import org.apache.commons.jcs.access.CacheAccess;
+
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
 import org.openstreetmap.josm.data.cache.CacheEntry;
 import org.openstreetmap.josm.data.cache.CacheEntryAttributes;
@@ -114,13 +111,11 @@
 				this.previousButton.setEnabled(false);
 
-			CacheAccess<String, BufferedImageCacheEntry> prev;
 			try {
 				this.mapillaryImageDisplay.setImage(null);
-				prev = JCSCacheManager.getCache("mapillary");
+				MapillaryPlugin.CACHE = JCSCacheManager.getCache("mapillary");
 				if (thumbnailCache != null)
 					thumbnailCache.cancelOutstandingTasks();
 				thumbnailCache = new MapillaryCache(image.getKey(),
-						MapillaryCache.Type.THUMBNAIL, prev, 200000, 200000,
-						new HashMap<String, String>());
+						MapillaryCache.Type.THUMBNAIL);
 				thumbnailCache.submit(this, false);
 
@@ -128,6 +123,5 @@
 					imageCache.cancelOutstandingTasks();
 				imageCache = new MapillaryCache(image.getKey(),
-						MapillaryCache.Type.FULL_IMAGE, prev, 200000, 200000,
-						new HashMap<String, String>());
+						MapillaryCache.Type.FULL_IMAGE);
 				imageCache.submit(this, false);
 			} catch (IOException e) {
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 31183)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java	(revision 31185)
@@ -3,10 +3,10 @@
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.util.Map;
+import java.util.HashMap;
 
-import org.apache.commons.jcs.access.behavior.ICacheAccess;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
 import org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin;
 
 public class MapillaryCache extends
@@ -20,8 +20,6 @@
 	}
 
-	public MapillaryCache(String key, Type type,
-			ICacheAccess<String, BufferedImageCacheEntry> cache,
-			int connectTimeout, int readTimeout, Map<String, String> headers) {
-		super(cache, connectTimeout, readTimeout, headers);
+	public MapillaryCache(String key, Type type) {
+		super(MapillaryPlugin.CACHE, 50000, 50000, new HashMap<String, String>());
 		this.key = key;
 		try {
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportDownloadThread.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportDownloadThread.java	(revision 31183)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportDownloadThread.java	(revision 31185)
@@ -4,17 +4,12 @@
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.HashMap;
 import java.util.concurrent.ArrayBlockingQueue;
 
 import javax.imageio.ImageIO;
 
-import org.apache.commons.jcs.access.CacheAccess;
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
 import org.openstreetmap.josm.data.cache.CacheEntry;
 import org.openstreetmap.josm.data.cache.CacheEntryAttributes;
 import org.openstreetmap.josm.data.cache.ICachedLoaderListener;
-import org.openstreetmap.josm.data.cache.JCSCacheManager;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryImage;
@@ -50,15 +45,7 @@
 	@Override
 	public void run() {
-		try {
-			CacheAccess<String, BufferedImageCacheEntry> prev = JCSCacheManager
-					.getCache("mapillary");
-			new MapillaryCache(image.getKey(), MapillaryCache.Type.FULL_IMAGE,
-					prev, 200000, 200000, new HashMap<String, String>())
-					.submit(this, false);
-		} catch (MalformedURLException e) {
-			Main.error(e);
-		} catch (IOException e) {
-			Main.error(e);
-		}
+		new MapillaryCache(image.getKey(), MapillaryCache.Type.FULL_IMAGE).submit(this,
+				false);
+
 	}
 
