Spectral curves, emergent geometry, and bubbling solutions for Wilson loops