rename variables
avoid repeating some image processing steps
tweak