create directory only if creating images