ImageUtils.getSizeAndType() utility plus tests

My personal preference is that once I start using promises, I use them everywhere. For instance, if your `findSizeAndType` helper function returned a promise, you could do something like:

```
var sizePromise = findSizeAndType(imageBlob, bytesToRead);
sizePromise.catch(function tryAgain(data) {
   ....
   return findSizeAndType(imageBlob, imageBlob.size);
   ....
   else throw data.error;
}).then(success, failure);
```