Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java	(revision 17552)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java	(revision 17553)
@@ -5,6 +5,8 @@
 
 import java.io.File;
+import java.io.IOException;
 import java.util.Date;
 import java.util.List;
+import java.util.Locale;
 import java.util.Objects;
 import java.util.function.Consumer;
@@ -19,6 +21,9 @@
 
 import com.drew.imaging.jpeg.JpegMetadataReader;
+import com.drew.imaging.jpeg.JpegProcessingException;
 import com.drew.imaging.png.PngMetadataReader;
+import com.drew.imaging.png.PngProcessingException;
 import com.drew.imaging.tiff.TiffMetadataReader;
+import com.drew.imaging.tiff.TiffProcessingException;
 import com.drew.metadata.Directory;
 import com.drew.metadata.Metadata;
@@ -588,5 +593,5 @@
         try {
             // try to parse metadata according to extension
-            String ext = fn.substring(fn.lastIndexOf(".") + 1).toLowerCase();
+            String ext = fn.substring(fn.lastIndexOf('.') + 1).toLowerCase(Locale.US);
             switch (ext) {
             case "jpg":
@@ -604,16 +609,16 @@
                 throw new NoMetadataReaderWarning(ext);
             }
-        } catch (Exception topException) {
+        } catch (JpegProcessingException | TiffProcessingException | PngProcessingException | IOException
+                | NoMetadataReaderWarning topException) {
             //try other formats (e.g. JPEG file with .png extension)
             try {
                 metadata = JpegMetadataReader.readMetadata(file);
-            } catch (Exception ex1) {
+            } catch (JpegProcessingException | IOException ex1) {
                 try {
                     metadata = TiffMetadataReader.readMetadata(file);
-                } catch (Exception ex2) {
+                } catch (TiffProcessingException | IOException ex2) {
                     try {
                         metadata = PngMetadataReader.readMetadata(file);
-                    } catch (Exception ex3) {
-
+                    } catch (PngProcessingException | IOException ex3) {
                         Logging.warn(topException);
                         Logging.info(tr("Can''t parse metadata for file \"{0}\". Using last modified date as timestamp.", fn));
Index: trunk/src/org/openstreetmap/josm/gui/io/importexport/ImageImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/importexport/ImageImporter.java	(revision 17552)
+++ trunk/src/org/openstreetmap/josm/gui/io/importexport/ImageImporter.java	(revision 17553)
@@ -8,7 +8,9 @@
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import javax.imageio.ImageIO;
@@ -30,5 +32,6 @@
      * The supported image file types on the current system
      */
-    public static final String[] SUPPORTED_FILE_TYPES = ImageIO.getReaderFileSuffixes();
+    public static final List<String> SUPPORTED_FILE_TYPES = Collections
+            .unmodifiableList(Arrays.stream(ImageIO.getReaderFileSuffixes()).sorted().collect(Collectors.toList()));
 
     /**
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 17552)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 17553)
@@ -243,4 +243,11 @@
 
         private boolean updateImageEntry(Image img) {
+            if (img == null) {
+                synchronized (ImageDisplay.this) {
+                    errorLoading = true;
+                    ImageDisplay.this.repaint();
+                    return false;
+                }
+            }
             if (!(entry.getWidth() > 0 && entry.getHeight() > 0)) {
                 synchronized (entry) {
