Working image viewer class, bug fix