Load images only while nothing else need to be loaded?

I want to load a bunch of images only when nothing else need to be loaded. So basically I have to check if something is currently loading or not. If something is currently loading I have to stop the image loading. Once again when nothing is loading I want to continue to load images again.

How do I check if something is currently loading? I could use a boolean variable called “loading” or something, but is there a better approach?