Switch to regex to convert relative image path to absolute one

Can't find a way to not use regex to perform that.