improved drag and drop layer creation logic to further reduce the possibility of a flicker