image num_bytes incorrectly defined as width*height. Should be width*height*num_channels. Currently, it seems only RGBA format is used, hence hardcoded 4