Bugfixes on imageviewer