Check if image is actually an image

Sometimes due to user error he/she will point to a GIF, JPG, PNG that returns a 404, webpage, or text.
We don't want to include this in an Ebook.