Index: /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java
===================================================================
--- /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(revision 30456)
+++ /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(revision 30457)
@@ -1,3 +1,3 @@
-//License: GPL (v2 or above)
+//License: GPL (v2 or later)
 package org.openstreetmap.josm.plugins.photo_geotagging;
 
@@ -283,10 +283,12 @@
             // instead, let's use new File(), which doesn't actually create a file
             // for getting a unique file name, we use UUID.randomUUID()
-            fileTmp = new File(file.getParentFile(), "img" + UUID.randomUUID() + ".jpg");
+            do {
+                fileTmp = new File(file.getParentFile(), "img" + UUID.randomUUID() + ".jpg");
+            } while (fileTmp.exists());
             if (debug) {
                 System.err.println("TMP: "+fileTmp.getAbsolutePath());
             }
             if (! file.renameTo(fileTmp))
-                throw new IOException(tr("Could not rename file!"));
+                throw new IOException(tr("Could not rename file {0} to {1}!", file, fileTmp));
 
             fileFrom = fileTmp;
