Maybe a quick fix is to use jpeg only images instead of webp. webP images seems to require more memory, I think.
It wouldn't surprise me if the third-party WebP image processor was to blame. There's no telling what kind of memory management it does. It could even have leaks.
And that's not the only reason for avoiding WebP images. Until the image processor is improved to the point that it's actually useful, I think it should be commented out of the UI and core code. Users shouldn't be allowed to select it, thinking that it's a good thing to do.