Added code to TextToPicturesActivity to handle rotation