def make_photo_dict(filename, media):
    """Generate a photo dict (filename, url) as in the ODKA JSON export."""
    if filename and filename in media:
        return dict(filename=filename, url=media[filename])
    else:
        return None