protected function _getResponse($request, $response, $server)
    {
        if ((empty($this->_params) ||
            (count($this->_params) === 1 && isset($this->_params['s'])))
            && $this->getConfig('originalPassThrough')
        ) {
            try {
                $response = $this->_passThrough($request, $response, $server);
            } catch (Exception $exception) {
                return $this->_handleException($request, $response, $exception);
            }

            return $response;
        }

        /** @var \League\Glide\Responses\ResponseFactoryInterface|null */
        $responseFactory = $server->getResponseFactory();
        if ($responseFactory === null) {
            $server->setResponseFactory(new PsrResponseFactory());
        }

        try {
            $response = $server->getImageResponse($this->_path, $this->_params);
        } catch (Exception $exception) {
            return $this->_handleException($request, $response, $exception);
        }

        return $response;
    }