checks type of uploaded file and only allows images