refactor: store data of the image in a struct so that I can get all the data out for re-use in other functions