Unifying the VTK-5 and VTK-6 code paths in the ImageFunction class.

Refs #3544.