Fixed IMREAD bug, added MAT-SCALE, for rid of all the foreign-free functions