First you have to make your 50x50 array instead of a 1d array:
my_array = my_array.reshape((50, 50))
, 8- , unsigned 8-bit integer dtype:
my_array = my_array.reshape((50, 50)).astype('uint8')
, True 1, , 255:
my_array = my_array.reshape((50, 50)).astype('uint8')*255
, PIL:
im = Image.fromarray(my_array)
:
im = Image.fromarray(my_array.reshape((50,50)).astype('uint8')*255)