File H4 as soon as possible.
You can only have a couple of weeks after layoff to do a safe H-1 transfer without help of other status. Someone makes a gap of one month but it is up to the officer. However, you can do a quite safe H-1B transfer with a gap of up to two months if the gap is filled with a legal status, in your case H4 or H4 pending.
