def contains_image(tweet):
    """Takes a python-native tweet (dict), returns True if tweet contains an image"""
    if 'entities' not in tweet:
        return False
    elif 'media' not in tweet['entities']:
        return False
    for m in tweet['entities']['media']:
        if m['type'] == 'photo':
            return True
    return False
