Index: /trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java	(revision 18242)
+++ /trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java	(revision 18243)
@@ -150,4 +150,5 @@
             ret += matchPoints(images, prevWp, prevWpTime, prevWp, prevWpTime, offset, false, trkTagTime, null, dirpos);
         }
+        Logging.debug("Correlated {0} total points", ret);
         return ret;
     }
@@ -211,5 +212,4 @@
             long offset, boolean interpolate, int tagTime, WayPoint nextWp, GpxImageDirectionPositionSettings dirpos) {
 
-        int ret = 0;
         final boolean isLast = nextWp == null;
 
@@ -222,8 +222,16 @@
         }
 
+        if (Logging.isDebugEnabled()) {
+            Logging.debug("Correlating images for i={1} - curWp={2}/{3} - prevWp={4}/{5} - nextWp={6} - tagTime={7} - interpolate={8}",
+                    i, curWp, curWpTime, prevWp, prevWpTime, nextWp, tagTime, interpolate);
+        }
+
         // no photos match
-        if (i < 0)
+        if (i < 0) {
+            Logging.debug("Correlated nothing, no photos match");
             return 0;
-
+        }
+
+        int ret = 0;
         Double speed = null;
         Double prevElevation = null;
@@ -273,5 +281,6 @@
             // This code gives a simple linear interpolation of the coordinates between current and
             // previous track point assuming a constant speed in between
-            LatLon nextCoorForDirection = nextWp != null ? nextWp.getCoor() : null;
+            @SuppressWarnings("null")
+            LatLon nextCoorForDirection = nextWp.getCoor();
             while (i >= 0) {
                 final GpxImageEntry curImg = images.get(i);
@@ -318,4 +327,5 @@
             }
         }
+        Logging.debug("Correlated {0} image(s)", ret);
         return ret;
     }
