register ImageViewer more elegantly.