This is overly-complicated. I would suggest doing something like this instead:

```
if height is not None:
    height = height * EMUS_PER_PIXEL
if width is not None:
    width = width * EMUS_PER_PIXEL

kwargs = {
    'r_id': r_id,
    'height': height,
    'width': width,
}
```

You don't need size at all.