fix media count problem in migration