fixed the query of pics bug