Fix display of modal dialogs when no images are open

Silly mistake :/