crucial bug fix in ttools.c

two wrong input assignments to img_coord function caused segmentation faults on Mac OS X.