Fixed compiler warning and bug in cimg save method