private function convertPsdToImage($content)
{
$temporaryFilePath = $this->createTemporaryFile($content);
try {
$image = $this->imagine->open($temporaryFilePath);
$image = $image->layers()[0];
unlink($temporaryFilePath);
return $image->get('png');
} catch (RuntimeException $e) {
unlink($temporaryFilePath);
throw new InvalidMimeTypeForPreviewException('image/vnd.adobe.photoshop');
}
}