added in save image function