bnc#821916: Better algorithm to find placeholder shape.

Placeholder type seems to be more relevant than index.

Change-Id: I9d6c6cad8e0a51b2385801f65d7d1c697ad7998e