Fix dimension calculation in heatmap plugin (fix #8193)