Learned imaging with constraints and uncertainty quantification