Generate a replacement histogram image if it was deleted using the current values
Minor refactor of histogram generation code