fix bug in image dimension write down