Displayed pictures count after a global search was wrong when using MySql