This is about ordering. If the <svg> comes after the <img>, it works.
The filter element build() functions return null if they have no renderer yet.
What we need to do is to invalidate the filtered element when the filter renderers change.
I think the main difference between SVG and CSS filters here is that SVG builds the filter chain at paint time, but CSS builds it at style change time, which is too early because we're still building the render tree at that point.