Chenges in Controller and Library to save images to imageArray