performance improvement on query pictures