Effects of variations in cavity geometry on the generation of picosecond pulses in Q-switched Nd: Glass and ruby lasers