PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined:
A parameter to a query is something that will go in the WHERE/HAVING clause, it can't be used to substitute text into the SELECT or FROM (or any other part) part of the query. As you've only got two proper parameters in the query (those after the WHERE clause), and you're passing several more as the arguments, you get an error informing you of the count mismatch.

You're also trying to pass in arrays as single string parameter replacements to the SELECT and FROM parts of the query, which will just never work (even if you could use parameter replacement in those part of the query). When cast to a string, the array will simply be the string Array, which is pretty much definitely not what you're looking for.

If you want to build those parts of your query dynamically you'll need to use db_select() instead. This code isn't a complete representation of your example but should get you going:

$query = db_select('content_' . $table_name, 'image');

$query-&gt;addExpression('image.' . $field_name);
$query-&gt;addExpression('image.' . $field2_name);
// etc...

$query-&gt;condition('vid', $vid);

$results = $query-&gt;execute();