Remove directory name from path
I think the Pathologic contributed module will do it. I have used it in the past and it's awesome. Configuration is a bit tricky, but once it's done you can forget about most file path problems. It's an input filter for text, so it can be used anywhere you can set an input format.

Configuration of Pathologic is covered here. I think it may have issues with internationalization in some cases though.