adds logic for switch between upload/preview