ImageResolver is javascript library that extracts the main image from an URL.
More on github