Add type hints for img transformation array operations to speed it up.
Fix bug associated with trying to load images outside applet context.