added preview mode and image-adding to editor