In terms of factoring the code have you considered the following:

```ruby
thumbnail = image
thumbnail = thumbnail.thumb(geometry) if geometry.present? && !geometry.is_a?(Symbol)
thumbnail.strip
```

I'm not advocating for it being better but it feels like it might be.