private function convertPsdToImage($resource)
    {
        $temporaryFilePath = $this->createTemporaryFile($resource);

        try {
            $image = $this->imagine->open($temporaryFilePath);
            $image = $image->layers()[0];

            unlink($temporaryFilePath);

            return $this->createTemporaryResource($image->get('png'));
        } catch (RuntimeException $e) {
            unlink($temporaryFilePath);

            throw new InvalidMimeTypeForPreviewException('image/vnd.adobe.photoshop');
        }
    }