fixed analyze.m to handle img name automatically