Missing Argument

You didn’t specify how many arguments your function accepts when you used add_filter:

add_filter( $tag, $function_to_add, $priority, $accepted_args );

Your code only passes a $tag and a $function_to_add, but it doesn’t tell WordPress what priority it should be, or how many accepted arguments your function takes. You need to fix that. If you don’t provide the 4th parameter, WordPress assumes your function only accepts 1 argument, even if you define 2 in your function ( $thumbnail and $atts ).

Also, if the filter only provides a single argument, then WordPress can’t pull a second argument out of thin air