Add exception handling in the image viewer zoom mode