refactored ImageViewerDialog to own class