Fix up calculation of image XML statistics