Made image_link easier to maintain

Is now using internal functions (DRY).