def is_image(child) -> bool:
    """Check if a post object has an image attached."""
    child_data = child["data"]
    child_url = child_data["url"]
    child_is_self = child_data["is_self"]
    return child_url.endswith((".jpg", ".jpeg", ".png", ".gif"))