I would hav thought stuff like Lemmy would have configurations to eg.: not allow to upload images locally, only hotlink.
Anyway, an alternative is "zero knowledge" storage, where you don't know what you are storing (hence, you can't "choose" what to host or not host either). Another alternative is disjoint storage, where two different servers store different halves of a file (eg.: an Odd Bytes server and an Even Bytes server), but this means now it's necessary to hit more servers to recover a file.
But the sensible thing to do IMO is to apply "common carrier" concept. The water distribution company is not, to my knowledge, held liable when something happens like you fill a bucket of water and share it with someone else.
If this later returns as
ed.ch
(more streamlined and lightweight, minimal featureset, perhaps not even the ability to store remote files so as to avoid the CSAM issues, etc) it'll be The Day.