Refactor Image::save with using generic lamdas