private function getImageMimeType($pFile)
    {
        if (File::fileExists($pFile)) {
            $image = getimagesize($pFile);

            return image_type_to_mime_type($image[2]);
        }

        throw new WriterException("File $pFile does not exist");
    }