Index: src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
===================================================================
--- src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 7920)
+++ src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(working copy)
@@ -372,6 +372,11 @@
     public void mergeFrom(Layer from) {
         GeoImageLayer l = (GeoImageLayer) from;
 
+        // Stop to load thumbnails on both layers.  Thumbnail loading will continue the next time
+        // the layer is painted.
+        stopLoadThumbs();
+        l.stopLoadThumbs();
+
         ImageEntry selected = null;
         if (l.currentPhoto >= 0) {
             selected = l.data.get(l.currentPhoto);
@@ -988,9 +993,7 @@
             @Override
             public void layerRemoved(Layer oldLayer) {
                 if (oldLayer == GeoImageLayer.this) {
-                    if (thumbsloader != null) {
-                        thumbsloader.stop = true;
-                    }
+                    stopLoadThumbs();
                     Main.map.mapView.removeMouseListener(mouseAdapter);
                     MapFrame.removeMapModeChangeListener(mapModeListener);
                     currentPhoto = -1;
@@ -1018,6 +1021,7 @@
 
     public void loadThumbs() {
         if (useThumbs && !thumbsLoaded) {
+            stopLoadThumbs();
             thumbsLoaded = true;
             thumbsloader = new ThumbsLoader(this);
             Thread t = new Thread(thumbsloader);
@@ -1026,6 +1030,20 @@
         }
     }
 
+    /**
+     * Stop to load thumbnails.  Can be called at any time to make sure that the
+     * thumbnail loader is stopped.
+     * @since tbd
+     */
+    public void stopLoadThumbs() {
+        if (thumbsloader != null) {
+            thumbsloader.stop = true;
+            if (!thumbsloader.done) {
+                thumbsLoaded = false;
+            }
+        }
+    }
+
     public void updateBufferAndRepaint() {
         updateOffscreenBuffer = true;
         Main.map.mapView.repaint();
@@ -1076,6 +1094,8 @@
         this.useThumbs = useThumbs;
         if (useThumbs && !thumbsLoaded) {
             loadThumbs();
+        } else if (!useThumbs) {
+            stopLoadThumbs();
         }
     }
 }
Index: src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java
===================================================================
--- src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java	(revision 7920)
+++ src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java	(working copy)
@@ -16,7 +16,8 @@
 public class ThumbsLoader implements Runnable {
     public static final int maxSize = 120;
     public static final int minSize = 22;
-    volatile boolean stop = false;
+    public volatile boolean stop = false;
+    public volatile boolean done = false;
     List<ImageEntry> data;
     GeoImageLayer layer;
     MediaTracker tracker;
@@ -50,6 +51,7 @@
                 }
             }
         }
+        done = true;
         layer.updateOffscreenBuffer = true;
         Main.map.mapView.repaint();
     }
