1. handler for picture construction test.
2. moved sme common methods to commons.js to make them reusable.