fix bugs - cache byte array in java object caused some error when write back to image / mp4