Switched painting over to a bufferedimage