Remove the query string from the path's extension if one exists. Fixes #75