Image thumbnail is broken on chat messages when using Cloudflare R2

Now that I am too utilizing chat I noticed this error too.
Thumbnail is indeed broken here and when I click the broken image it shows the image in a “popup” as it should.

The url for the broken image is indeed not the CDN url.

Broken url (redacted some bits)

https://BUCKET.REDACTED.eu.r2.cloudflarestorage.com/optimized/1X/21ec5908f511bdc9fa7970107b40fad3f008327c_2_500x500.jpeg

Working url

https://cdn.pelittaa.fi/optimized/1X/21ec5908f511bdc9fa7970107b40fad3f008327c_2_500x500.jpeg