include thumbnails in backups was disabled on the source instance. I just ran rake posts:rebake inside the discourse container and I got the following result:
root@vps-app:/var/www/discourse# rake posts:rebake
Rebaking post markdown for 'default'
628 / 628 (100.0%)
628 posts done!
To be double sure, I invalidated the CDN cache but still I’m unable to view any images. Also, I’m unable to upload any images so I doubt this solution can solve that issue.