fix / update for broken gallery sorting

adds two new functions, one to query the gallery on the admin side, and one to properly save it. also includes JS for sorting items and some general cleanup
Nonce check is kosher, but we don't need to return the $post_id, just return, as it's in an action.