If in one of the images, there are both dogs and sheep.
return images ;return dogs in  #1 ;return sheep in  #1 ;return number of  #2 for each  #1 ;return number of  #3 for each  #1 ;return #1 where  #4 is at least two ;return #1 where  #5 is at least two ;return #1 in  both  #6 and #7 ;return number of  #8 ;return if  #9 is equal to  one
['select', 'project', 'project', 'group', 'group', 'comparative', 'comparative', 'intersection', 'aggregate', 'boolean']