To check if a resource is available you can add the following to a Please wait / Loading routine.
Pick the name of the last resource required for the next stage of the experiment.
See Loading sounds on the fly - #15 by thomas_pronk
Each Frame
try {
psychoJS.serverManager.getResource(expInfo["participant"] + ".jpg");
continueRoutine = false;
}
catch (e) {}