Change code to display image attachment page

  1. As pointed in the other answer, you should not have prettyPhoto part

  2. The link should be changed to utilize the function get_attachment_link

Basically change this line in your code

$link = '<a href="'.get_attachment_link($id).'">'.wp_get_attachment_image($id, $size, false).'</a>';

techhipbettruvabetnorabahisbahis forumutaraftarium24eduedusedueduseduedusedusedueduedu