implemented saving Image file