Extracted the img replacement into a plugin

Spaces around parens