Support for max texture size on some GPUs

Scale the image and its parameters to avoid going over the max 2D texture
size supported on WebGL on a particular browser. Tested on Chrome.
Merge remote-tracking branch 'elafargue/photosphere/master'

- Resolved conflicts and merged with elafargue/photosphere@91bc9fddd11cb8713a7e4d25d7628bd69ae51ad0
- Bugfix: Scale image only if it exceeds max 2D texture size.