providers/docker: more robustly detect built image [GH-4598]