improved img replacement regex