Enforce hash-level deduplication so the same binary image cannot be uploaded multiple times.
Scope
- Add a database-level unique constraint on image hash (
sha256).
- Update upload write path to handle uniqueness violations gracefully.
- Return a user-facing duplicate error that explains the image already exists.
- Keep existing successful upload flow unchanged for new images.
Acceptance Criteria
- Attempting to upload the same image bytes twice does not create a second image row.
- Duplicate uploads return a deterministic, user-friendly error response.
- New unique images continue uploading successfully.
- Automated tests cover both first-upload success and duplicate-upload rejection.