# Start with a blank image - somehow this causes memory cleanup $TK{'image-'.$NVP{'Id'}}=$TK{'canvas-'.$NVP{'Id'}}->Photo(-file => "" ); # Create an image object for the image file of the correct format $TK{'image-'.$NVP{'Id'}}=$TK{'canvas-'.$NVP{'Id'}}->Photo($NVP{'Id'}, -file => $NVP{'File'}, -format => $image{'extension'});