Use gaufrette to get media mime type

| Q                    | A
| -------------------- | ---
| Bug fix?             | yes
| New feature?         | no
| BC breaks?           | no
| CI currently passes? | maybe
| Tests pass?          | yes
| Scenarios pass?      | yes
| Checkstyle issues?   | no
| Changelog updated?   | no
| Fixed tickets        |
| Doc PR               |