def parse_image_metadata(results):
    """Parse container image metadata from Snyk results."""
    # Parse image and digest
    results['image'] = results['docker']['image']['logicalRef']
    results['digest'] = results['docker']['image']['physicalRef'].split('@', 1)[-1]

    # Add URL to detailed results
    try:
        results['url'] = f"https://app.snyk.io/org/{results['org']}/project/{results['projectId']}/"
    except KeyError:
        # Some results are missing projectId?
        pass

    return results