public function resize($pathToImage)
    {
        $file = $this->storage->get($pathToImage);

        $this->sizes->each(function ($size, $key) use ($pathToImage, $file) {
            $img = app(ImageManager::class)->make($file);
            $path = $this->createThumbPath($pathToImage, $key);

            switch ($size[2]) {
                case 'width':
                    // resize the image to a width of $sizes[ 0 ] and constrain aspect ratio (auto height)
                    $img->resize($size[0], null, function ($constraint) {
                        $constraint->aspectRatio();
                    });
                    break;
                case 'height':
                    // resize the image to a height of $sizes[ 1 ] and constrain aspect ratio (auto width)
                    $img->resize(null, $size[1], function ($constraint) {
                        $constraint->aspectRatio();
                    });
                    break;
                // 'resize' or any other fullbacks to this
                default:
                    $img->fit($size[0], $size[1]);
                    break;
            }

            $this->storage->put($path, $img->stream()->__toString());
        });
    }