Improved image searching and fixed a potential problem in img paths.

Searching both static and media root folders for images if
one does not contain the other. Fixed image_revise method, which
would result in exceptions when an image is not found in media/static
folders.