a few more bug fixes to image util