qualify variable names and correct final image save location