I need a unique way of adding css with js?

Hello:) I am aware of most of the ways to do this. But none seem to fit my needs on this one. Usually I use jquery to add the class of “js” to the HTML and use html.js {yada} but its too slow in this circumstance. I am loading a image 5 seconds after page load with jquery. But using the html method of adding display none the image flashes briefly. I imagine if I were to put all the jquery at the top then it may not happen. Buts that’s not an option. Currently I just have display none in the css. But that does not degrade well. The only way I can think of is to use documentwrite to insert display none and place this above my css links. This would work but its messy and I have to go in and add it to all my pages (I don’t trust find and replace). Any other methods I’m not thinking of that would insert display none before the image loads on the page? Thanks!

You could add the images to a container that is already hidden? It doesn’t even have to be attached to the DOM, and can just be a document fragment.
You could then hide the images and then move them to where they need to go.