Updated level parsing to use common detect_image function.