Short answer: use an immutable key per upload and per derivative size, keep the original under a generation prefix, and copy it to an archive key before generating thumbnails. Object storage is a good fit for ordinary e-commerce image delivery; it is a poor fit when recovery from an accidental overwrite or strict writer concurrency is the primary requirement.
That decision is less about WebP versus AVIF than about who owns the write boundary. My rule is simple: the database owns the current image manifest, while the bucket stores immutable bytes. A product image might be represented as products/sku-1842/01c8f7/original.jpg , with derivatives such as .../webp/640.webp and .../avif/1280.avif . The upload id (or content hash) makes each generation distinct.…