public function url($reset = true)
    {
        /** @var UniformResourceLocator $locator */
        $locator = Grav::instance()['locator'];
        $image_path = $locator->findResource('cache://images', true);
        $image_dir = $locator->findResource('cache://images', false);
        $saved_image_path = $this->saveImage();

        $output = preg_replace('|^' . preg_quote(GRAV_ROOT, '|') . '|', '', $saved_image_path);

        if ($locator->isStream($output)) {
            $output = $locator->findResource($output, false);
        }

        if (Utils::startsWith($output, $image_path)) {
            $output = '/' . $image_dir . preg_replace('|^' . preg_quote($image_path, '|') . '|', '', $output);
        }

        if ($reset) {
            $this->reset();
        }

        return trim(Grav::instance()['base_url'] . '/' . $this->urlQuerystring($output), '\\');
    }