adding image handling routines