Before the media pending approval stage, but after upload, they should be yet another processs where the files are pumped through a Compressor, like:
https://www.freeconvert.com/compress-jpeghttps://compresspng.com/https://www.freeconvert.com/video-compressorThe booru and the wiki should pump all their entire stock through something like
https://compresso.io/bulk-compress or
https://imagetoolshub.com/tools/bulk-image-compressor/ and then replace the used files with the replacements.
This will make it impossible to embed illegal thinngs inside files (future), and will heroically wipe out all previous cases of things being p-embedded even if no-one knew about it or not (past)