fix incorrect truncation in Img function, (Thanks Nigel Tao)