-q will only print image ID, but we want the tag name.

See the example output below for reference:

[~/ws/jenkins/acceptance-test-harness@elf] (master)
% docker images -q jenkins/git
8358d533fa3f
[~/ws/jenkins/acceptance-test-harness@elf] (master)
% docker images jenkins/git
REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
jenkins/git         8a32ffed0448        8358d533fa3f        About a minute ago   113.1 kB (virtual 432 MB)