3 random images from custom post type, each in a div with a diffrent class

Getting different classes in the divs is relatively simple and mostly not a WordPress question, but there are WordPress bits to it that need comment. Truncated code reformatted for legibility:

$classes = array(
  'side left',
  'middle',
  'side right'
);
$qry = new WP_Query(
  array(
    'post_type'=> 'portfolio',
    'posts_per_page' => 3,
    'orderby' => 'rand',
    'order' => 'ASC'
  )
);
if ($qry->have_posts()) { 
  while ($qry->have_posts()) { 
    $qry->the_post(); ?>
    <div class="pcscreen <?php echo $classes[$qry->current_post%3] ?>"><?php
  }
}

The actual class insertion part isn’t really a WordPress question but…

Please don’t use query_posts, ever.

It should be noted that using this to replace the main query on a page
can increase page loading times, in worst case scenarios more than
doubling the amount of work needed or more
. While easy to use, the
function is also prone to confusion and problems later on. See the
note further below on caveats for details.

http://codex.wordpress.org/Function_Reference/query_posts (emphasis mine)

Secondly, you were using the deprecated showposts parameter even though you were also using the correct posts_per_page in the same argument set.

Third, and not strictly “WordPress” either, that alternative control structure syntax is nothing but confusing. Use brackets and indent your code properly. You will thank me later.

Likewise with that “query-string like” argument syntax– hard to read, hard to edit. Use arrays.

Finally, PHP opening and closing tags (<?php and ?>) are not line start/line stop markers. Don’t use them as such. Only use them when you actually need to switch between PHP and HTML. You will gain readability and reduce typing, both good things.