Added code to use saved images, but crashes