Can't save image while rendering
There is another solution. I encountered a similar problem where it showed a red dialogue box saying image cannot be written. So I just made another folder in the same directory and saved it in that folder. It worked perfectly!
(solution for Windows 10)