Refactoring, using tempfile for photos. Not converting to gifs clientside