Image viewer bugfixes.