Fixing compilations errors in trans_image.c reworking some function in image.c