refactored the ninepatch
added loading code for ninepatch