added printing to download image method for better debugging