I can see a problem here. If your image is only linked by the CSS with custom code, chances are it’s not going to be published or exported. A workaround would be to create a page only for displaying the image so it’s part of the published datas. Do that, then analyse the url of the image once published, from there you can deduct the relative path to your image… don’t you?
When images are uploaded they are uploaded to a CDNso they are not relative. In the exporting process we make them relative. Try to add the image to the asset manager and then copy the URL in the image settings (an icon next to the filename). And try to use that.
When duplicating sites we clean up unused images from the asset manager. I’m not sure if it would clean up that image so you’d have to test it. If you’re not planning on duplicating the site then don’t worry about this.
That means all the images of the asset manager are published event if they’re not in any page? Or is the custom code being read to include possible images too?