Fix bug and account for elements with display:none

Fix a bug that prevented new elements from being postponed after all the
previously postponed elements were removed from the queue.

Also, properly account for and deal with images with stle property
`display:none;`.