Add an index on images.filename

See bug #9872.