Add support for base_path with directory

Currently the base_path does not support directories.

**img:** `/img/dir/img.jpg`
**base_path:** `http://basepath.com/namespace/`
**result:** `http://basepath.com/img/dir/img.jpg`
**desired result**: `http://basepath.com/namespace/img/dir/img.jpg`


This pull request will allow the above. Tests have been added.