Well what I did is I put a seperate chamber before the actual plant chamber with a rock medium inside, and have the polluted water flow over that, and as it does that, bacteria forms. The bacteria stay in the area of the rocks because I guess they attach themselves to it.

As you can see in that picture, there is a little cylindrical chamber above on the top right, which holds the rocks and bacteria.