Media library fixes