Fix to mismatched range lengths in backgrounds functionality

Script now inserts new rows to compensate for mistmatch