If I understood you correctly what you want to achieve, you can simply combine both:
query/results/json/feed/entry[contains(gsx_type/_t,'recommended')][eval:('Math.floor(Math.random()*7)+1')]
However, this eval:()
function looks very strange to me, you might also be able to use a random module provided by your processor or call a functions differently. Also, if you have 12 pictures you might want to change the 7
to 12
.