added config option to set image dir