You need to pass the "headers" parameter in requests.get() method. It seems that the server you are trying to access does not allow requests without a user-agent.
Modify your code as follows and it should work.
def save_image_file(ilink, filename):
ua = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7'
response = requests.get(ilink, headers={"User-Agent": ua})
if response.status_code == 200:
with open(filename, 'wb') as f:
f.write(response.content)
else:
print("Bad response code :", response.status_code, ilink)
If the above user-agent does not work, you can search for others and try them.