Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java	(revision 18936)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java	(revision 18937)
@@ -147,6 +147,9 @@
         MapFrame map = MainApplication.getMap();
         synchronized (ImageViewerDialog.class) {
-            if (dialog != null && map != null && map.getToggleDialog(ImageViewerDialog.class) != null) {
-                map.removeToggleDialog(dialog);
+            if (dialog != null) {
+                if (map != null && map.getToggleDialog(ImageViewerDialog.class) != null) {
+                    map.removeToggleDialog(dialog);
+                }
+                dialog.destroy();
             }
         }
@@ -181,10 +184,5 @@
             // We need to check to see whether or not the worker is shut down. See #22922 for details.
             if (!MainApplication.worker.isShutdown() && this.isDialogShowing()) {
-                MainApplication.worker.execute(() -> GuiHelper.runInEDT(() -> {
-                    Component selected = this.layers.getSelectedComponent();
-                    if (selected instanceof MoveImgDisplayPanel) {
-                        ((MoveImgDisplayPanel<?>) selected).fireModelUpdate();
-                    }
-                }));
+                MainApplication.worker.execute(() -> GuiHelper.runInEDT(this::showNotify));
             }
         });
@@ -303,4 +301,7 @@
         if (geoImageLayers.isEmpty()) {
             this.layers.setVisible(false);
+            hideNotify();
+            if (hasInstance())
+                destroyInstance();
         } else {
             this.layers.setVisible(true);
@@ -315,4 +316,6 @@
                 this.getImageTabs().filter(m -> m.layer.containsImage(this.currentEntry)).mapToInt(this.layers::indexOfComponent).findFirst()
                         .ifPresent(this.layers::setSelectedIndex);
+            } else if (selected == null) {
+                updateTitle();
             }
             this.layers.invalidate();
@@ -352,4 +355,5 @@
                             removeImageTab(((MoveImgDisplayPanel<?>) layers.getComponentAt(index)).layer);
                             getImageTabs().forEach(m -> m.setVisible(m.isVisible()));
+                            showNotify();
                             return;
                         }
@@ -417,7 +421,7 @@
         imageRemoveFromDiskAction.destroy();
         imageZoomAction.destroy();
+        toggleAction.destroy();
         cancelLoadingImage();
         super.destroy();
-        destroyInstance();
     }
 
@@ -1066,5 +1070,4 @@
             btnCollapse.setVisible(!isDocked);
         }
-        this.updateLayers(true);
     }
 
