Filter, or any way to dynamically change theme screenshot image?

From quick look WP seems to process array of theme data in a way that is used for both PHP and JS sides.

Result passes through wp_prepare_themes_for_js filter, which seems like a suitable place to override screenshot URL as necessary.

This worked in my dev install:

add_filter( 'wp_prepare_themes_for_js', function ( $themes ) {

    $themes['r-test']['screenshot'][0] = 'http://dev.rarst.net/wordpress/src/wp-content/themes/twentyfifteen/screenshot.png';

    return $themes;
} );

Of course the nuance is that theme has to be running for its code to execute. If you need to do this for inactive themes the code would have to be placed/running outside of them.