Reads an image into an ndarray