There are tons of gallery scrips - not sure if there is one correlated with a calendar though. The concept is *simple* - although that term is relative to one's knowledge. You should probably be able to find a free calendar script on any script site, and then it's just finding the code where it makes the date cell, and then searching through your database for any events/whatever that correspond with that date.
Not an ideal solution, but one a "do-it-yourselfer" might find useful. Best way would be to have a script know what month is being looked at, pull all events/whatever from the database relative to that month, order by day, and then include them in the correct day cell (<td>). This way you're only making 1 "educated" call to the database, storing the results in an array, and then using a pointer to step through it by day.
$year = !isset($_GET['year']) || !is_numeric($_GET['year']) ? date('Y') : $_GET['year'];
$month = !isset($_GET['month']) || !is_numeric($_GET['month']) || $_GET['month'] < 1 || $_GET['month'] > 12 ? date('m') : $_GET['month'];
$qr = mysql_query('select name from events where date BETWEEN "'.date('Y-m-\1 00:00:00',strtotime($year.'-'.$month)).'" AND "'.date('Y-m-t 23:59:59',strtotime($year.'-'.$month)).'" order by date');
$events = array();
while($rs = mysql_fetch_assoc($qr))
$day = date('j',strtotime($rs['date']));
$events[$day] = $rs;
** calendar building code here **
The above might just confuse you, but at the end, you're left with an array with somethign similar to: array(1 => array(event 1 stuff,event 2 stuff,...)) where the 1 in 1 => represents the first day of the month.
Yea, probably just more confusing and odds are that code would need to be cleaned up a little bit. It also makes a few assumptions about your database
... anyway, chalk it up to me being bored and over helping/assuming.