Hi Anna,
Actually, the error message is quite good clue! I think you are using DIanoga package for image optimization (this one or previous versions). As far as I remember, it might not be compatible with media files stored on AWS or Azure. The main reason is that it uses System.IO library instead of CMS.IO to work with files (refer here). What you can do, is download sources of Dianoga library and fix it. Or uninstall Dianoga.
If you are using Kentico 11 and higher you can also consider using ImageMagick instead (here is my blog post).