Implement a function kernel_pca_rbf that performs Kernel Principal Component Analysis using the Radial Basis Function (RBF) kernel. Kernel PCA is a nonlinear dimensionality reduction technique that uses the kernel trick to project data into a higher-dimensional feature space where linear PCA is performed.
Given an input data matrix X of shape (n_samples, n_features), the number of components to extract, and the gamma parameter for the RBF kernel, your function should:
The RBF kernel between two points x and y is defined as K(x, y) = exp(-gamma * ||x - y||^2).
Note: To ensure consistent results, enforce a sign convention where the element with the largest absolute value in each eigenvector column is positive. Sort principal components by eigenvalue in descending order.