Looks like we use imageWidth and imageHeight only once and right after we declared it, maybe we can just merge it to targetWidth and targetHeight declaration respectively. Or do you think that it will become less readable?