fix bug: when addWrite, imageDir haven't save