added heat map construction in images.R