Double randomization

Hi! The structure of my stimuli encompasses 40 categories, and each category includes 5 images. In each stimulating slide, all the five images of one category should be presented on the screen, but in random order. Also, the 40 categories must be randomized across sessions (of the same subject; six in total).
I already get to present the five images randomly (cf. the file attached; just three categories for simplicity), but I had to use all the SuperLab levels: events, trials, and blocks, and, therefore, I am missing the randomization of the categories.
So, my question is: is there a more elegant way to do this?
BTW for each category, the subject must choose none, one, two, …, or all the five pictures.
Thanks in advance. (393 KB)