trying to store previous pictures in an array but failed.