The UI code in here should all get moved into an ImageViewer module or something similar