Fixed memleak in JNI code, added API to resize on-screen button image