I would use visualAssert + Repeat/If - For more details please see
If {picture} then {do this} - #2 by admin
Wait for Button and for second page load - #2 by Plankton