ImageUtils.getSizeAndType() utility plus tests

This should return a rejected promise for consistency.