Typescript convert byte array to image