Try adding this code in your theme functions.php or even better create a new plugin and paste the code there
define("LIMIT_FILE_UPLOADS", 2);
add_filter("adverts_gallery_upload_prefilter", "limit_file_uploads");
function limit_file_uploads( $file ) {
if ( !isset($file["name"]) || !isset($file["type"]) ) {
return $file;
}
if ( !isset( $_POST["post_id"] ) ) {
$post_id = 0;
} else {
$post_id = intval($_POST["post_id"]);
}
if( $post_id < 1 ) {
// first image upload.
return $file;
}
$attachments = get_children( array( 'post_parent' => $post_id ) );
$images = count( $attachments );
if( $images >= LIMIT_FILE_UPLOADS ) {
$file["error"] = sprintf( "You cannot upload more than %d images.", LIMIT_FILE_UPLOADS );
}
return $file;
}
In the first line change define("LIMIT_FILE_UPLOADS", 2);
change 2 to max number of images (per ad) you want users to be able to upload.