fix bug with double saving of media
fix category management when creating a media