Fix image path display issue. add path checking logic.