Fix problem with LATEX_SMALL_IMAGES.

A recent change from macros to functions changed the scoping rules
that caused the variable that held the raster scale to not be defined
where the build targets were generated (and thus scaling did not occur).