generate proper label for image blocks in HTML/LaTeX