move IM_X and IM_Y to image_size.h
add a very minor performance tweak