Added MSA mask_image function.