"•".repeat(apiKey.length - 8) threw RangeError when the key was shorter than 8 chars, crashing the media-provider detail page.
Resolve body.size through sizeToAspectRatio and append the ratio as a -WxH suffix so the executor's parseImageConfig picks it up. Also fall back to gemini-3.1-flash-image when a non-image model reaches the image handler.