Next.js Image Fetch Failing with 400 Error on Netlify Deployment

I’m currently experiencing issues with Next.js image optimization on my Netlify deployment. Optimized images are returning 400 errors with the message:

“The requested resource isn’t a valid image.”

My setup:

  • Next.js Runtime: v5.10.4
  • Deployment: Netlify using @netlify/plugin-nextjs
  • Image Location: Images are stored in /_next/static/media/

netlify.toml configuration:

[[redirects]]
  from = "/_next/image*"
  to = "/_next/image:splat"
  status = 200

Initially, I faced issues loading CSS and static images. I used the Netlify API to purge the site cache, which resolved the CSS loading issue—but optimized images still return 400 errors.

Is there something else I need to configure or clear for image optimization to work correctly?

Thanks in advance for your help!

Do you have a URL to share?