Replace substring OpenAI endpoint detection with exact parsed-host matching.
Route gallery image endpoint construction through a constant path allowlist.
Remove client-visible exception and upstream response body leaks from gallery image flows while preserving diagnostics in server logs.
Add focused regression tests for OpenAI host matching, checked endpoint joining, harmonize SSRF hardening, and sanitized client errors.