more refactoring
rewriting better version of OldImageViewer