Minimal factorizations of rational matrix functions in terms of polynomial models