Index: /trunk/src/org/openstreetmap/josm/io/JpgImporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/JpgImporter.java	(revision 12285)
+++ /trunk/src/org/openstreetmap/josm/io/JpgImporter.java	(revision 12286)
@@ -16,5 +16,4 @@
 import org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
-import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -88,5 +87,5 @@
     }
 
-    private static void addRecursiveFiles(List<File> files, Set<String> visitedDirs, List<File> sel, ProgressMonitor progressMonitor)
+    static void addRecursiveFiles(List<File> files, Set<String> visitedDirs, List<File> sel, ProgressMonitor progressMonitor)
             throws IOException {
 
@@ -107,5 +106,5 @@
                     }
                 } else {
-                    if (Utils.hasExtension(f, "jpg")) {
+                    if (FILE_FILTER.accept(f)) {
                         files.add(f);
                     }
Index: /trunk/test/unit/org/openstreetmap/josm/io/JpgImporterTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/io/JpgImporterTest.java	(revision 12286)
+++ /trunk/test/unit/org/openstreetmap/josm/io/JpgImporterTest.java	(revision 12286)
@@ -0,0 +1,46 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.io;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+/**
+ * Unit tests of {@link OsmApi} class.
+ */
+public class JpgImporterTest {
+
+    /**
+     * Setup test
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/14868">Bug #14868</a>.
+     * @throws IOException if an error occurs
+     */
+    @Test
+    public void testTicket14868() throws IOException {
+        List<File> files = new ArrayList<>();
+        JpgImporter.addRecursiveFiles(files, new HashSet<>(), Arrays.asList(
+                new File("foo.jpg"), new File("foo.jpeg")
+                ), NullProgressMonitor.INSTANCE);
+        assertEquals(2, files.size());
+        assertEquals("foo.jpg", files.get(0).getName());
+        assertEquals("foo.jpeg", files.get(1).getName());
+    }
+}
