fixed bug in image optimizer