Made some changes with saving images