Creating images from a file specified by its path, and from a numpy array with appropriate shape