update image download
tidy code