Modified custom.js carousel layout code.

Make getHeight wait for image to finish loading.