split image-viewer directive to image-viewer.js and fix the bug of submit property type.