Automatic stacking mechanism for solar panels