public function getImageMimeType($user, $imageIdentifier)
{
try {
$data = $this->getImageCollection()->findOne(['user' => $user, 'imageIdentifier' => $imageIdentifier]);
} catch (MongoException $e) {
throw new DatabaseException('Unable to fetch image meta data', 500, $e);
}
if ($data === null) {
throw new DatabaseException('Image not found', 404);
}
return $data['mime'];
}