Yeah I think you want something like this:
```java
setImageDrawable(res != 0 ? buildDrawable(resId) ? null);
```