def sf_img_regex(exts = [])
      exts = [exts].flatten unless exts.is_a?(Array)
      if exts.nil? || exts.empty?
        exts = %w(jpg jpeg png gif)
      elsif exts.include?(:jpg) && !exts.include?(:jpeg)
        exts.push :jpeg
      end
      %r{(^http{1}[s]?://([w]{3}\.)?.+\.(#{exts.join('|')})(\?.+)?$)}i
    end
def sf_img_regex(exts = [])
      exts = [exts].flatten unless exts.is_a?(Array)
      if exts.nil? || exts.empty?
        exts = %w(jpg jpeg png gif)
      elsif exts.include?(:jpg) && !exts.include?(:jpeg)
        exts.push :jpeg
      end
      %r{(^http{1}[s]?://([w]{3}\.)?.+\.(#{exts.join('|')})(\?.+)?$)}i
    end
Build image regexes according to the required extensions.

 Example:
   >> sf_img_regex
   => /(^http{1}[s]?:\/\/([w]{3}\.)?.+\.(jpg|jpeg|png|gif)(\?.+)?$)/i
   >> sf_img_regex([:jpg, :png])
   => /(^http{1}[s]?:\/\/([w]{3}\.)?.+\.(jpg|png)(\?.+)?$)/i
 Arguments:
   exts: (Array)
     - Image extensions which will be included in the regex.