Make image cache aware of image-scaling-factor (bug#74725)
* src/dispextern.h (struct image): Add scale so it can be compared in
search_image_cache.
* src/image.c (search_image_cache): Calculate the scale factor and
compare with the cached value.
(image_compute_scale): Compute the image's scale factor and optionally
store it in the image struct.
(compute_image_size): Move scale calculation code into
image_compute_scale and use it.
(cherry picked from commit
691c161a81221905f7e2690ee747ba9163b1b645)