AES-128 as compression function in Merkle-Damgard construction
This short thesis describes some of the basic ways in which to use the Merkle-Damgård construction based on block ciphers. The construction that is commonly used in MD5 and related constructions is in fact an instance of the Davies-Meyer construction. This could be directly applied to your construction (you have to add length padding and a length field to get a secure hash function of course) as follows: let $E_k(m)$ be a block cipher (like AES) with key $k$ and message block $m$, then we take $f(W_i) = E_{m_i}(W_{i-1}) \oplus W_{i-1}$ for $i=1,\ldots n$. This way we get a secure hash function, provided $E$ is a secure block cipher in the appropriate sense (essentially indistinguishable from a random permutation).