feature #2589: Close the image/template creation dialog only if the call succeeds