1. A method comprising: obtaining, for a query and by a data processing apparatus, a measure of importance of image quality for selecting images to be provided in response to the query, wherein obtaining the measure of importance comprises: comparing a first number of previous user interactions with high quality images that were provided in response to the query and a second number of previous user interactions with high quality images provided in response to other queries, a high-quality image being an image having a measure of visual quality that exceeds a threshold measure of visual quality; and selecting the measure of importance based on a difference between the first number and the second number; and selecting, in response to receiving the query and by a data processing apparatus, images to be provided in response to the query, the images being selected based on query scores for the images, the query score for at least one selected image being based, at least in part, on a visual quality score for the selected image and the measure of importance of image quality for the query.