All of the permissions should be the same for created directories in all folders. The default directory permissions are on the top of the include file where the function that creates the directory is found. It might just be that the image was corrupted or being accessed at the time the script was running, or even was re-created while the script was running.