<s>[INST] import requests
import os

def download_image(url, filename):
    try:
        response = requests.get(url)
        response.raise_for_status()
        if not os.path.exists(os.path.dirname(filename)):
            os.makedirs(os.path.dirname(filename))
        with open(filename, 'wb') as file:
            file.write(response.content)
    except requests.RequestException as e:
        print(f"Error downloading image: {e}")
        return False
    return True

url = "https://example.com/image.jpg"
filename = "images/image.jpg"

download_image(url, filename)

Here is a simple image downloader. How can I improve this?[/INST]