I would combine the top level ifs to remove a level of indentation

```ruby
    if Regexp === options[:src]
      if image = find_image_with_regex(options[:src])
        locator.concat("[@src='#{image}']")
      else
        return false
      end
    elsif options[:src]
      locator.concat "[@src='#{options[:src]}']"
    end
```