Dyalog APL, 9999 83 82 bytes
a←{⍵/'01'0 1}¨(↓3 2⍴4 3 3)
{a⊢←↓⍉↑a{⍺∘{⍵/⊂⍺}¨⍵}¨↓3 3⍴⍵}¨(3 2 3 3 3 2 1 1 19/5)(1 1 1 3 3 3 3 4∘⊤¨1386531 3)496098
1000⍴∊a
Definitely not the intended solution as this still has a lot of hardcoded data, but it's a start.