Solving Large-Scale Inverse Problems via Approximate Message Passing and Optimization