I have been trying image uploading in Laravel 5 (upload generated through laravelcollective/forms, and processed using Intervention Image library).
What I wanna do is when user uploads any photo, I want to set the extension based on its mimetype. There should be some basic check to protect against spurious data injection.

```
$file_profile_image->getClientMimeType();

```

To do that, should I simply be mapping like so **?**

```
['image/jpeg' => 'jpg', 'image/gif'=> 'gif']

```