refactering : using deleteImage