fixed #390: When doing gif recording if directory not exist then create it