Add explicit imgid to query to be more resilient to changes.
(cherry picked from commit 24321b90bf2326d5a4506c0d6e0f4f81a4835875)