Using a variable to define image path

Thank you @damien1 for your suggestion. Does this “future proof” my posts so I could use any source. Local or external sites like aws, cloudinary or cloudimage?
I really don’t want to switch to a proprietary solution. I guess there is an old-fashioned search and replace and run it through you posts to change the source but I think that is a rather old-fashioned method.