Finished preparing the data for image. Not tested