public void checkUnsavedImages() {
        for (JInternalFrame internalFrame : desktopPane.getAllFrames()) {
            if (internalFrame.getTitle().startsWith("*")) {
                ((ImageInternalFrame) internalFrame).deIconified();
                int option = JOptionPane.showOptionDialog(null,
                        internalFrame.getTitle().substring(1) + " is unsaved, save?", "save?", JOptionPane.YES_NO_CANCEL_OPTION,
                        JOptionPane.QUESTION_MESSAGE, smallLogo, null, null);
                switch (option) {
                    case JOptionPane.CANCEL_OPTION:
                        return;
                    case JOptionPane.YES_OPTION:
                        ((ImageInternalFrame) internalFrame).saveImageFile();
                }
            }
            ((ImageInternalFrame) internalFrame).close();
        }
    }