For me the problem was that in the backend change the DEBUG env variable to false, and the server stopped from serve the image properly (needed another configuration).
But in summary, the problem was the server, not Next.js.