Fix a bug where the wrong base path for URLs would be used in certain situations.

This commit also adds functionality to post a warning when an image can not be loaded.