fixed the saving image bug