adding function to replace all IMG tags in body texts with the corresponding media tokens