fixed bug in image read