devtools/hackdoc: propagate ref in imgs and redirects

Change-Id: Ideb2a8f10f8193cd782b0e1d913e7aa99bbfa52f
diff --git a/devtools/hackdoc/markdown.go b/devtools/hackdoc/markdown.go
index 06e2c6e..14ffe45 100644
--- a/devtools/hackdoc/markdown.go
+++ b/devtools/hackdoc/markdown.go
@@ -27,7 +27,7 @@
 	r.RenderHeader(&buf, ast)
 	buf.Write([]byte(`</div><div class="content">`))
 	ast.Walk(func(node *blackfriday.Node, entering bool) blackfriday.WalkStatus {
-		if ref != "" && entering && node.Type == blackfriday.Link {
+		if ref != "" && entering && node.Type == blackfriday.Link || node.Type == blackfriday.Image {
 			dest := string(node.Destination)
 			u, err := url.Parse(dest)
 			if err == nil && !u.IsAbs() {