Extra error handling for direct calls

This should give you a proper error message when the direct calling of images does not work. Don't forget to setup (and chmod) the /cache/-folder for images to work.