Return image url basing on path('public')

Replace pattern was taking hardcoded '/public' to generate image url in editor. It was not consistent with user setting. Now it strips proper public path.