changed: variable names for clarity; added: image size abstraction