Altered read_image to pass the struct by reference rather than value.
Altered read_image to pass the struct by reference rather than value.