united states is a topic gallery that has which image?
Entity Entity
m.02nbh90 m.059h_54
800px-Flag_of_the_United_States.svg.png united-states.jpg
class entity
common.image m.09c7w0
common.image common.topic
Image united states
none none
common.image.appears_in_topic_gallery
Appears In Topic Gallery
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX : <http://rdf.freebase.com/ns/> 
SELECT (?x0 AS ?value) WHERE {
SELECT DISTINCT ?x0  WHERE { 
?x0 :type.object.type :common.image . 
VALUES ?x1 { :m.09c7w0 } 
?x0 :common.image.appears_in_topic_gallery ?x1 . 
FILTER ( ?x0 != ?x1  )
}
}
(AND common.image (JOIN common.image.appears_in_topic_gallery m.09c7w0))