| change interface from pass by value to by reference

Althrough for his::Matrix, passing by reference may be thread unsafe in
extreme cases, while pass a shared_ptr by value has well defined
behavior.
Anyway parameters of type his::MatrixWrapper can not bear a destruction
from other threads, to make it consistent, we pass reference for both of
these types.
It is the user's responsibility to make sure images live through the
entire process.