add ImageViewer
ported some code to oop