Resizing images off server

There are many S3 providerers now. See Configure an S3 compatible object storage provider for uploads.

I’m pretty sure that even if you can figure out how to do what you’re trying to do, you’ll be sorry that you did.