When using Nextjs image they will work fine locally, but you need to configure the trusted domains for deployments on real domains.
module.exports = {
images: {
formats: ['image/avif', 'image/webp'],
remotePatterns: [
{
protocol: 'https',
hostname: 'res.cloudinary.com',
port: '',
pathname: '/YOUR-ACCOUNT/**',
},
],
},
}