Codomain may be a relatively recent precision of the language.
You're interpreting "range" as only meaning the image, but "range" has also been used to mean the codomain. according to a couple of cites here: http://en.wikipedia.org/wiki/Range_%28mathematics%29
Wikipedia for Range of a Function.
I agree it can be troublesome when the books are not carefully distinguishing these ideas. However, many students will be tasked with domain and range concepts from pre-algebra courses when their knowledge of functions is usually limited to discrete cases or linear real-valued functions. In later courses, students will see and write things like $\frac{x^2}{x-1}$ is a function from $\mathbb{R}\to\mathbb{R}$. This kind of serves as describing the function as "real inputted" with the origin set, and it provides the codomain explicitly. (Students are usually tasked to find the domain (meaning pre-image) and range (meaning image)).
A source of these confusions may be that the codomain is so often $\mathbb{R}$, that it is deemed automatic.
One way to tease out the difference with a class is to discuss the function of $student \to birthmonth$. Here you can say that the domain is students in the class (noting that you, the teacher, is not an element of the domain). The codomain is the set of twelve months. And the image is the actual set of months acquired, which may not be the entire codomain. (best if your students don't cover all 12 ;)