Added some regex function to check if url is an image or not so we can check this sort of thing.