#CJam, 129116
26mr:D;q~:B;){B[7B),I8m<f+[0_X256]ff+[Z6]2*f.{\1{2md7\#\j_**2G#f#10222@#f*2G#)%}j\K+%D+26%'A+}f%_2ew:R[1f=R3f=R2f%]"\/+23f%\W<26f%]{D+26%'A+}f%~"\/\X"2"f*_:$@2/.f*'|f*Sf*~\_''Xf*[@]'|f*Sf*~_'{f>"-+"f=+"f=\@}fI;]N*%2>-3<N* [Try it online][1]
Uses only letters.
Explanation:
The first observation is that any rectangular piece of a solved board is a solved board. Since the program needs to work up to 255×255, it is enough to solve it for that case and use a piece of that board with the requested dimensions.
I am using a fixed 255×255 board that I determined to be correct. I actually did 256×256 tiles first, choosing 2 numbers per tile (top and left), then copied the other numbers from adjacent tiles, discarding some edge numbers from the last row and last column.
Each tile is first given an associated number, and then I calculate the remainders of that number modulo two other numbers (I used 23 and 26) to get the 2 numbers chosen for that tile.
In order to avoid patterns which lead to duplication, I decided to make the associated numbers pseudo-random and unique. I used my favorite distinct not-very-random number generator, which is based on primitive roots: take a prime number slightly bigger than the desired range (65537) and a small prime number (7), then use the powers of the small number modulo the big number. After a few trials, I found that the combination of 7, 23 and 26 works well, giving 65025 (255²) unique tiles.
For the random factor, I am just applying a random cyclic permutation to the value of each number. Then the numbers (0-25) are converted to letters (A-Z).
Code explanation to follow.
[1]: http://cjam.aditsu.net/#code=26mr%3AD%3Bq~%3AB%3B%7BB%2CI8m%3Cf%2B%5B0_X256%5Dff%2B%5BZ6%5D2*f.%7B%5C1%7B2md7%5C%23%5Cj_**2G%23http://cjam.aditsu.net/#code=26mr%3AD%3Bq~%3AB%3B)%25%7Dj%5CK%2B%25D%2B26%25'A%2B%7D%3AR%5B1f%3DR3f%3DR2f%25%5D%22%5C%2F%2F%5CX%222%2F.f*'%7Cf%7B%5B7B)%2Cf%2310222%40%23fSf2G%23)f%25_2ew%3A%2B23f%25%5CW%3C26f%25%5D%7BD%2B26%25'A%2B%7Df%25~%22%5C%2F%22f~%5C_'%7Bf%3E%22%3A%24%402%2F'Xf*%5B%40%5D'%7CfSf~'%7Bf%3E%22-%2B%22f%3D%7DfI%3B%5DN*&input=20%2012%2B%22f%3D%5C%40%7D%252%3E-3%3CN*&input=100%2012