public function registerMediaConversions(Media $media = null)
    {
        $conversions        = config('assetlibrary.conversions');

        foreach ($conversions as $key => $value) {
            $conversionName = $key;

            $this->addMediaConversion($conversionName)
                ->width($value['width'])
                ->height($value['height'])
                ->keepOriginalImageFormat()
                ->optimize();
        }

        if (config('assetlibrary.allowCropping')) {
            $this->addMediaConversion('cropped')
                ->keepOriginalImageFormat()
                ->optimize();
        }
    }