Index: /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 2591)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 2592)
@@ -322,5 +322,5 @@
                     return;
                 }
-                JFileChooser fc = new JFileChooser(Main.pref.get("tagimages.lastdirectory", Main.pref.get("lastDirectory")));
+                JFileChooser fc = new JFileChooser(Main.pref.get("geoimage.lastdirectory", Main.pref.get("lastDirectory")));
                 fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
                 fc.setMultiSelectionEnabled(true);
@@ -343,5 +343,5 @@
                 LinkedList<File> files = new LinkedList<File>();
                 addRecursiveFiles(files, sel);
-                Main.pref.put("tagimages.lastdirectory", fc.getCurrentDirectory().getPath());
+                Main.pref.put("geoimage.lastdirectory", fc.getCurrentDirectory().getPath());
                 GeoImageLayer.create(files, GpxLayer.this);
             }
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 2591)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 2592)
@@ -37,4 +37,5 @@
 import javax.swing.ButtonGroup;
 import javax.swing.JButton;
+import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 import javax.swing.JFileChooser;
@@ -149,5 +150,5 @@
                             if (!sel.getName().equals(wrapper.name)) {
                                 JOptionPane.showMessageDialog(
-                                		Main.parent,
+                                        Main.parent,
                                         tr("File {0} is loaded yet under the name \"{1}\"", sel.getName(), wrapper.name),
                                         tr("Error"),
@@ -173,18 +174,18 @@
                     x.printStackTrace();
                     JOptionPane.showMessageDialog(
-                    		Main.parent, 
-                    		tr("Error while parsing {0}",sel.getName())+": "+x.getMessage(),
-                    		tr("Error"),
-                    		JOptionPane.ERROR_MESSAGE
-                    		);
+                            Main.parent,
+                            tr("Error while parsing {0}",sel.getName())+": "+x.getMessage(),
+                            tr("Error"),
+                            JOptionPane.ERROR_MESSAGE
+                            );
                     return;
                 } catch (IOException x) {
                     x.printStackTrace();
                     JOptionPane.showMessageDialog(
-                    		Main.parent, 
-                    		tr("Could not read \"{0}\"",sel.getName())+"\n"+x.getMessage(),
-                    		tr("Error"),
-                    		JOptionPane.ERROR_MESSAGE
-                    		);
+                            Main.parent,
+                            tr("Could not read \"{0}\"",sel.getName())+"\n"+x.getMessage(),
+                            tr("Error"),
+                            JOptionPane.ERROR_MESSAGE
+                            );
                     return;
                 }
@@ -293,5 +294,5 @@
             cbTimezones = new JComboBox(vtTimezones);
 
-            String tzId = Main.pref.get("tagimages.timezoneid", "");
+            String tzId = Main.pref.get("geoimage.timezoneid", "");
             TimeZone defaultTz;
             if (tzId.length() == 0) {
@@ -351,5 +352,5 @@
 
                 public void actionPerformed(ActionEvent arg0) {
-                    JFileChooser fc = new JFileChooser(Main.pref.get("tagimages.lastdirectory"));
+                    JFileChooser fc = new JFileChooser(Main.pref.get("geoimage.lastdirectory"));
                     fc.setAcceptAllFileFilterUsed(false);
                     fc.setMultiSelectionEnabled(false);
@@ -387,9 +388,9 @@
             while (! isOk) {
                 int answer = JOptionPane.showConfirmDialog(
-                		Main.parent, panel, 
-                		tr("Synchronize time from a photo of the GPS receiver"), 
-                		JOptionPane.OK_CANCEL_OPTION,
-                		JOptionPane.QUESTION_MESSAGE
-                		);
+                        Main.parent, panel,
+                        tr("Synchronize time from a photo of the GPS receiver"),
+                        JOptionPane.OK_CANCEL_OPTION,
+                        JOptionPane.QUESTION_MESSAGE
+                        );
                 if (answer == JOptionPane.CANCEL_OPTION) {
                     return;
@@ -413,5 +414,5 @@
                 String tzValue = selectedTz.substring(pos + 1, selectedTz.length() - 1);
 
-                Main.pref.put("tagimages.timezoneid", tzId);
+                Main.pref.put("geoimage.timezoneid", tzId);
                 tfOffset.setText(Long.toString(delta / 1000));
                 tfTimezone.setText(tzValue);
@@ -476,7 +477,7 @@
         panelTf.add(new JLabel(tr("Timezone: ")), gc);
 
-        float gpstimezone = Float.parseFloat(Main.pref.get("tagimages.doublegpstimezone", "0.0"));
+        float gpstimezone = Float.parseFloat(Main.pref.get("geoimage.doublegpstimezone", "0.0"));
         if (gpstimezone == 0.0) {
-            gpstimezone = - Long.parseLong(Main.pref.get("tagimages.gpstimezone", "0"));
+            gpstimezone = - Long.parseLong(Main.pref.get("geoimage.gpstimezone", "0"));
         }
         tfTimezone = new JTextField();
@@ -498,5 +499,5 @@
         panelTf.add(new JLabel(tr("Offset:")), gc);
 
-        long delta = Long.parseLong(Main.pref.get("tagimages.delta", "0")) / 1000;
+        long delta = Long.parseLong(Main.pref.get("geoimage.delta", "0")) / 1000;
         tfOffset = new JTextField();
         tfOffset.setText(Long.toString(delta));
@@ -557,4 +558,14 @@
         panelTf.add(rbUntaggedImg, gc);
 
+        gc.gridx = 0;
+        gc.gridy = 5;
+        gc.gridwidth = 2;
+        gc.gridheight = 1;
+        gc.fill = GridBagConstraints.NONE;
+        gc.weightx = gc.weighty = 0.0;
+        yLayer.loadThumbs = Main.pref.getBoolean("geoimage.showThumbs", false);
+        JCheckBox cbShowThumbs = new JCheckBox(tr("Show Thumbnail images on the map"), yLayer.loadThumbs);
+        panelTf.add(cbShowThumbs, gc);
+
         ButtonGroup group = new ButtonGroup();
         group.add(rbAllImg);
@@ -573,14 +584,14 @@
         GpxDataWrapper selectedGpx = null;
         while (! isOk) {
-        	ExtendedDialog dialog = new ExtendedDialog(
-        			Main.parent,
+            ExtendedDialog dialog = new ExtendedDialog(
+                    Main.parent,
                 tr("Correlate images with GPX track"),
                 new String[] { tr("Correlate"), tr("Auto-Guess"), tr("Cancel") }
-        			);
-
-        	dialog.setContent(panel);
-        	dialog.setButtonIcons(new String[] { "ok.png", "dialogs/geoimage/gpx2imgManual.png", "cancel.png" });
-        	dialog.showDialog();
-        	int answer = dialog.getValue();
+                    );
+
+            dialog.setContent(panel);
+            dialog.setButtonIcons(new String[] { "ok.png", "dialogs/geoimage/gpx2imgManual.png", "cancel.png" });
+            dialog.showDialog();
+            int answer = dialog.getValue();
             if(answer != 1 && answer != 2)
                 return;
@@ -624,9 +635,18 @@
             }
 
-            Main.pref.put("tagimages.doublegpstimezone", Double.toString(gpstimezone));
-            Main.pref.put("tagimages.gpstimezone", Long.toString(- ((long) gpstimezone)));
-            Main.pref.put("tagimages.delta", Long.toString(delta * 1000));
-
+            yLayer.loadThumbs = cbShowThumbs.isSelected();
+
+            Main.pref.put("geoimage.doublegpstimezone", Double.toString(gpstimezone));
+            Main.pref.put("geoimage.gpstimezone", Long.toString(- ((long) gpstimezone)));
+            Main.pref.put("geoimage.delta", Long.toString(delta * 1000));
+            Main.pref.put("geoimage.showThumbs", yLayer.loadThumbs);
             isOk = true;
+
+            if (yLayer.loadThumbs) {
+                Thread tl = new Thread(new ThumbsLoader(yLayer.data));
+                tl.setPriority(Thread.MIN_PRIORITY);
+                tl.start();
+            }
+
         }
 
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 2591)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 2592)
@@ -71,4 +71,6 @@
     public long timeoffset = 0;
 
+    boolean loadThumbs;
+
     /*
      * Stores info about each image
@@ -117,5 +119,5 @@
 
         protected void rememberError(String message) {
-        	this.errorMessages.add(message);
+            this.errorMessages.add(message);
         }
 
@@ -138,5 +140,5 @@
             if (cancelled) {
                 return;
-            }            
+            }
             progressMonitor.subTask(tr("Read photos..."));
             progressMonitor.setTicksCount(files.size());
@@ -173,7 +175,4 @@
             layer = new GeoImageLayer(data);
             files.clear();
-            Thread thumbsloader = new Thread(new Thumbsloader());
-            thumbsloader.setPriority(Thread.MIN_PRIORITY);
-            thumbsloader.start();            
         }
 
@@ -216,5 +215,5 @@
                         }
                     } else {
-                    	rememberError(tr("Error while getting files from directory {0}\n", f.getPath()));
+                        rememberError(tr("Error while getting files from directory {0}\n", f.getPath()));
                     }
 
@@ -230,28 +229,28 @@
 
         protected String formatErrorMessages() {
-        	StringBuffer sb = new StringBuffer();
-        	sb.append("<html>");
-    		if (errorMessages.size() == 1) {
-    			sb.append(errorMessages.iterator().next());
-    		} else {
-    			sb.append("<ul>");
-    			for (String msg: errorMessages) {
-    				sb.append("<li>").append(msg).append("</li>");
-    			}
-    			sb.append("/ul>");
-    		}
-    		sb.append("</html>");
-    		return sb.toString();
+            StringBuffer sb = new StringBuffer();
+            sb.append("<html>");
+            if (errorMessages.size() == 1) {
+                sb.append(errorMessages.iterator().next());
+            } else {
+                sb.append("<ul>");
+                for (String msg: errorMessages) {
+                    sb.append("<li>").append(msg).append("</li>");
+                }
+                sb.append("/ul>");
+            }
+            sb.append("</html>");
+            return sb.toString();
         }
 
         @Override protected void finish() {
-        	if (!errorMessages.isEmpty()) {
-        		JOptionPane.showMessageDialog(
-        				Main.parent,
-        				formatErrorMessages(),
-        				tr("Error"),
-        				JOptionPane.ERROR_MESSAGE
-        		);
-        	}
+            if (!errorMessages.isEmpty()) {
+                JOptionPane.showMessageDialog(
+                        Main.parent,
+                        formatErrorMessages(),
+                        tr("Error"),
+                        JOptionPane.ERROR_MESSAGE
+                );
+            }
             if (layer != null) {
                 Main.main.addLayer(layer);
@@ -276,45 +275,6 @@
             cancelled = true;
         }
-        
-        class Thumbsloader implements Runnable {
-            public void run() {
-                System.err.println("Load Thumbnails");
-                MediaTracker tracker = new MediaTracker(Main.map.mapView); 
-                for (int i = 0; i < layer.data.size(); i++) {
-                    System.err.println("getImg "+i);
-                    Image img = Toolkit.getDefaultToolkit().createImage(layer.data.get(i).file.getPath());
-                    tracker.addImage(img, 0);
-                    try {
-                		tracker.waitForID(0);
-            	    } catch (InterruptedException e) {
-            	        System.err.println("InterruptedException");
-                		return; //  FIXME
-            	    }
-    	            BufferedImage scaledBI = new BufferedImage(16, 16, BufferedImage.TYPE_INT_RGB);
-                    Graphics2D g = scaledBI.createGraphics();
-                    while (!g.drawImage(img, 0, 0, 16, 16, null))
-                    {
-                        try {
-                            Thread.sleep(10);
-                        } catch(InterruptedException ie) {}
-                    }
-                    g.dispose();
-                    tracker.removeImage(img);
-                    layer.data.get(i).thumbnail = scaledBI;
-                    if (Main.map != null && Main.map.mapView != null) {
-                        Main.map.mapView.repaint();
-                    }
-                }
-                
-//                boolean error = tracker.isErrorID(1);
-//                if (img != null && (img.getWidth(null) == 0 || img.getHeight(null) == 0)) {
-//                    error = true;
-//                }
-
-
-            }
-        }        
-    }
-    
+    }
+
     private static boolean addedToggleDialog = false;
 
@@ -424,11 +384,11 @@
                 Point p = mv.getPoint(e.pos);
                 if (e.thumbnail != null && e.thumbnail.getWidth(null) > 0 && e.thumbnail.getHeight(null) > 0) {
-                    g.drawImage(e.thumbnail, 
-                                p.x - e.thumbnail.getWidth(null) / 2, 
+                    g.drawImage(e.thumbnail,
+                                p.x - e.thumbnail.getWidth(null) / 2,
                                 p.y - e.thumbnail.getHeight(null) / 2, null);
                 }
                 else {
-                icon.paintIcon(mv, g, 
-                               p.x - icon.getIconWidth() / 2, 
+                icon.paintIcon(mv, g,
+                               p.x - icon.getIconWidth() / 2,
                                p.y - icon.getIconHeight() / 2);
                 }
@@ -537,5 +497,5 @@
         Main.main.map.repaint();
     }
-    
+
     public void checkPreviousNextButtons() {
         System.err.println("check: " + currentPhoto);
@@ -598,6 +558,4 @@
                         ImageViewerDialog.showImage(GeoImageLayer.this, e);
                         Main.main.map.repaint();
-                        
-                        
                         break;
                     }
@@ -628,4 +586,3 @@
         });
     }
-
 }
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 2591)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 2592)
@@ -135,5 +135,5 @@
             System.out.println(e);
             if (e.getWhen() - lastTimeForMousePoint > 1500 || mousePointInImg == null) {
-            	lastTimeForMousePoint = e.getWhen();
+                lastTimeForMousePoint = e.getWhen();
                 mousePointInImg = comp2imgCoord(visibleRect, e.getX(), e.getY());
             }
