added save method for images