Putting in a new option to check Referrer and also fixing the thrown exceptions for images.