public function download($directory)
    {
        if (!file_exists($directory)) {
            if (!@mkdir($directory, null, true)) {
                throw new DownloadException("The download directory cannot be created.");
            }
        }

        $url = $this->getImageUrl();

        $this->client->get($url, [
            'save_to' => $directory . '/' . basename($url),
        ]);
    }