Design the lifecycle before the endpoint.
An upload endpoint is only one part of a photo system. Product teams also need a stable asset identity, an original they can recover, derivatives they can reproduce, and a clear access policy. Separating those responsibilities makes it easier to change an editor or storage provider without changing the meaning of every photo in your app.
01 /Receive with limits
Set accepted formats, pixel limits, and file-size budgets before accepting an upload. A filename and a browser-provided media type are hints, not proof of a valid image.
02 /Keep a stable original
Give the photo an application-owned asset ID. Keep the original separate from public delivery URLs and record orientation, dimensions, ownership, and processing state.
03 /Create useful derivatives
Define a small set of named outputs: a thumbnail, a feed image, and a detail view. Record the transformation recipe so a derivative can be regenerated.
04 /Deliver with an access policy
Public catalog photos and private family photos need different caching and authorization decisions. Make deletion and access revocation part of the design from the start.