Fix a crash when double clicking the dst image
Tighten up clone2

It's much more efficient for channels to be the inner loop (we can
reuse the same factorization of A for all channels). Also, build A using
setFromTriplets instead of repeatedly inserting single elements.