Trustworthy scientific inference for inverse problems with generative models