handle relative paths for uploaded files better