Fix infinite loop when adding a Fill Layer to the image
We should invent some better way avoid this loop... Right now the construction a bit fragile :)
BUG:388818