Fix texture dimensions check

Re: commit 37adc2e341584c646a94235a390d1cef634c0672

The indices on the left-hand side of the comparison were switched,
without switching the right-hand side ones too.

As such, square textures would work but others would throw
an error – this should fix the problem.
Merge pull request #5 from stackgl/fix-dim-check

Fix texture dimensions check