Fix image unicode issues

Fixes #2015.

* changes image pygame to use file objects instead of the file path because pygame has issues with unicode filenames.
* Since unicode filenames are allowed, when computing the cache keys for the textures we have to make sure to use bytes or unicode depending on the type of the filename, otherwise it tries to encode/decode the filename which causes unicode errors. So the key is now the same type as the filename.