This is an extremely common problem. The true geeks among us know how to resize and compress an image before uploading. The rest of the world just knows (barely) how to upload an original image from their phone, which can easily be more than 2 Meg., sometimes much bigger than that.
I discussed this a number of times in the early days of Codidact (e.g., the Forum). There has to be some limit for a bunch of reasons. This is a problem SomewhereElse as well. I actually made a small email-based solution at:
My original (hence the domain "picturepdf.com") project is an email-based utility to convert a picture to a PDF, which I created after too many times dealing with customers who received images from elsewhere that should have been PDFs but weren't, and as a result would print too big or small, etc. The shrink page takes an image via email and turns it into a .jpg (no matter what the starting type, since .jpg is (a) universal and (b) compressible) with a maximum size of 1.5 Meg.
This is not a perfect solution. Ideal is something built in to Codidact and with more options. But anyone is free to use it (no charge, no watermark, images erased from my server as soon as the processing is done) and hopefully it can inspire a solution here.