refactor method download image