Improved the downloadImage() function by passing urls instead of response objects.