You have already asked this at
How to display images with the same title?[
^] .
But now you have removed searching for the title and left the ID in the query while I suggested to remove the ID and not the title from the query.
But even then it might not work as expected because you may get multiple results. How would you want them to be displayed in a single row?
The common solution is to provide some kind of filter controls that can be used to load only selected (matching) items and show them in the grid view. This can be off course also implemented by clicking on a specific cell and using that as filter criteria but would require that there is another control to reset the filter and re-load all data.
I suggest that you should think about this and define how data should be displayed (with optional filtering) before starting to implement related code.