Upload images in chat can't be show normally when use s3 CDN

User upload image in chat can’t show normally.

But when I click it, it can display correctly.

I checked the html and found when it can’t be shown normally. The URL is S3 URL.

Looks like the src url is incorrect. Thanks.