cleaned up media extension handling