added command line option to set image output directory