Wait until mask is loaded to prevent empty image bug. Add support for scaled images.
Merge pull request #6 from imises/master

Fix mask bug, add support for scaled images.