fix a bug with editing then creating a media
Merge pull request #342 from arnaudbey/fixEditMedia

fix a bug with editing then creating a media