Fixed a few issues related to the image viewer