fix docker images -tree <invalid_image> and docker images -viz <image_name>

Fixes #3106
Fixes #3107

Refactor -tree and -viz, it's the same thing, only the display differs.