create all subdirectories for image