I had the same issue with wkhtmltopdf
wkhtmltopdf 0.12.2.1 (with patched qt)
with debian 9 installed with the package.
wkhtmltox-0.12.2.1_linux-jessie-amd64.deb
I enabled the internal links with the command option
--enable-internal-links
I used the target:
<a name="name_of_target"><div><img src="image.png">Content</div></a>
and the link
<a href="#name_of_target">Link Text</a>
But still not working, other link in the document worked well.
Then I replaced the div with a span and it worked.
<a name="name_of_target"><span><img src="image.png">Content</span></a>
The issue is related with the display block rule of div elements. When I added display block rule to the span the link not worked again.