Layout-aware Single-image Document Flattening