Remove subdomain from path

Good Afternoon,

I have changed my app to have a subdomain due to hosting issues

I have amended a fair bit of code to get it working but a struggling with linking to some images.

if i remove the subdomain from the URL it works no problem, How would i do this dynamically for these images (the path comes from DB)

Regards