improved ImageStackDirectoryWriter: creates directory on demand