def METHOD_NAME(pth):
	ext = pth.split(".")[-1]
	small_pth = pth + "-small"
	if os.path.exists(data_dir['images'](small_pth)):
		resp = static_file(small_pth,root=data_dir['images']())
	else:
		try:
			from pyvips import Image
			thumb = Image.thumbnail(data_dir['images'](pth),300)
			thumb.webpsave(data_dir['images'](small_pth))
			resp = static_file(small_pth,root=data_dir['images']())
		except Exception:
			resp = static_file(pth,root=data_dir['images']())
	#response = static_file("images/" + pth,root="")
	resp.set_header("Cache-Control", "public, max-age=86400")
	resp.set_header("Content-Type", "image/" + ext)
	return resp