Minor bug fix to image loading stuff. Cleanup of stats collect