The error message seems to be complaining about the shape, but it is really about the data type. Multiplying by 255 and then changing to uint8 fixed the problem for me:
random_array = np.random.random_sample(content_array.shape) * 255
random_array = random_array.astype(np.uint8)
random_image = Image.fromarray(random_array)