added image download feature,needs refactoring