I ended up with the following code:
def lead_image(self):
"""Return lead image information, if present. We try to guess
the information based on field names as it's useless to try
to deal with the ILeadImage interface.
:returns: lead image information
:rtype: dict or None
"""
image = getattr(self.context, 'image', None)
if image is None:
return None # no "image" field
if not isinstance(image, NamedBlobImage):
return None # not a real image
url = '{0}/@@download/image/{1}'.format(
self.context.absolute_url(), image.filename)
caption = getattr(self.context, 'image_caption', None)
width, height = image.getImageSize()
return dict(url=url, caption=caption, width=width, height=height)