fix the thumbnail bug for images excpet jpg
fix the discussion link bug in lesson attachement page
fix the attachments and discussion count updating problem