Moved all uploaded files to subfolder, removing the need for global PATHS - also cleaned up unused variables
reverted changes of last commit - global variables removed altogether, not stored in Flask.g, analyzing options moved into session