It sounds like the hardest part of what you need done would be finding a way to get the 50 randomly selected images out of the 100 studied images. It would be much easier to specify these 50 selected images as constants, rather than have them randomly selected from the batch of 100 studied images.

If you made that small change to what you need completed, all of your other requirements would be possible using the WGR and BGR values. Both MediaLab and DirectRT would be able to successfully complete this task.