Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1080646

FF throws js exception ```IndexSizeError: Index or size is negative or greater than the allowed amount``` in drawImage when source width or source height is zero.
Also i add check for blitw and blith.
Merge pull request #2879 from caiiiycuk/workaround_1080646

Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1080646