add download image function