Image rewrite code, salvaged from tesing branch

During the sprint in August, this code ended up in a way that was hard to
get back into master. This brings it over whole-sale.
Merge pull request #63 from oerpub/copy-image-rewrite

Copy plugin changes for url rewriting