Several improvements for the media management