added functionality to download an image