Added SwingUtilities.invokeLater() to prevent the NPE exception.
npe exception fixed.
Fixed the NPE exception, which was causing flickering of the screen when there were multiple images open.
REversed ProcessDialog back to the original state to identify the problem.