trim uploaded filename if too long and remove pdfs from being tracked