png: add error messages and fix mapping of non-2^n textures