Vortex merging in quasi-geostrophic flows