Index: src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
===================================================================
--- src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java	(revision 17551)
+++ src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java	(working copy)
@@ -4,8 +4,10 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
 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;
 
@@ -18,8 +20,11 @@
 import org.openstreetmap.josm.tools.Logging;
 
 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;
 import com.drew.metadata.MetadataException;
@@ -587,7 +592,7 @@
 
         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":
             case "jpeg":
@@ -603,17 +608,18 @@
             default:
                 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: src/org/openstreetmap/josm/gui/io/importexport/ImageImporter.java
===================================================================
--- src/org/openstreetmap/josm/gui/io/importexport/ImageImporter.java	(revision 17551)
+++ src/org/openstreetmap/josm/gui/io/importexport/ImageImporter.java	(working copy)
@@ -10,6 +10,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import javax.imageio.ImageIO;
 
@@ -29,7 +30,8 @@
     /**
      * 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 = Arrays.stream(ImageIO.getReaderFileSuffixes()).sorted()
+            .collect(Collectors.toUnmodifiableList());
 
     /**
      * The default file filter
Index: src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
===================================================================
--- src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 17551)
+++ src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(working copy)
@@ -242,6 +242,13 @@
         }
 
         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) {
                     int width = img.getWidth(this);
