Fix the method imagePathToId.