Move exception for not found media just after media retrieving

Exception was moved just after the media retrieve method call.

This will prevent this error:

```
sonata.media.create_thumbnail : 
Fatal error: Call to a member function setProviderReference() on a non-object in vendor/sonata-project/media-bundle/Sonata/MediaBundle/Consumer/CreateThumbnailConsumer.php on line 53
```