Fixed Esc not closing the preview dialog