Court upholds NYS gun licensing fee