Fix saveIMG functionality