Trying to get PDF or any file other than image to uplaod.
A little code cleanup