[Image Viewer] Fixed problem with setting state