Fix bugs : crash when save image