Store image format in self when opening an image.