Fixed 301 error with curl and image download