testing conversion between image and array