Save attachment urls as relative paths

Hey,

Saving the gallery image urls as relative paths makes it easier to the site between domains, for example you local dev environment to the production environment. That's the problem I had. This little fix should solve that problem, and I think more people might benefit from it.

I also remove trailing whitespaces from most php and css files.