Extracted the img replacement into a plugin

So the idea from @benschwarz is that we can further clean up metaQuery by taking the image replacement code out of the core and making it a plugin.