Consider rewriting the photo endpoints as:
```python
_add_photo_endpoint = partial(do,
    require_http_method("POST"),
    login_or_401,
    instance_request,
    creates_instance_user,
    render_template('treemap/partials/photo_carousel.html'))

add_map_feature_photo_endpoint = _add_photo_endpoint(add_map_feature_photo)

add_tree_photo_endpoint = _add_photo_endpoint(add_tree_photo)
```