implements --mode option. image size fit to screen width or height.