Added scaleImg function

Made some changes to MSC code and scaling operation is almost done.