Expands or pads an array to specified row and column dimensions