import re


def fetchthumb(item):
	"""
		Get the thumbnail image for an item if possible
	"""

	text = item.summary
	if 'content' in item:
		text = item.content[0].value

	# regex to get an image if available
	thumb_search = re.search('(https?:\/\/[\S]+\.(jpg|png|jpeg))', text, re.IGNORECASE)

	if thumb_search:
		return thumb_search.group(1)
	else:
		return None