RIS-Assisted Joint Uplink Communication and Imaging: Phase Optimization and Bayesian Echo Decoupling