Hopefully it is the last time I try to achieve such effect as I am switching gallery to Zen Photo so lets see result at first:

I don’t know how to write plugin for Zen Photo yet (which hook should I use?) so lets edit source.
Open zp-core/lib-Imagick.php file and search for function zp_imageOutput. It should end with line:
return $bg->writeImages($filename, true);
Replace it with code:
$im->borderImage("white", 5, 5);
$im->borderImage("grey60", 1,1);
$shadow=$im->clone();
$shadow->setImageBackgroundColor( new ImagickPixel( 'black' ) );
$shadow->shadowImage( 60, 4, 4, 4 );
$shadow->compositeImage( $im, Imagick::COMPOSITE_OVER, 0, 0 );
$bg = $shadow->clone();
$bg->colorFloodFillImage("white", 100, '#777777', 0, 0);
$bg->compositeImage($shadow, Imagick::COMPOSITE_OVER, 0, 0);
$bg->flattenImages();
// wrong place - should be for $im not $bg
$d = $bg->getImageGeometry();
$w = $d['width'];
$h = $d['height'];
$amplitude = $w * 0.01;
$wavelength = $h * (rand(5) + 5);
$bg->rotateImage("white",90);
$bg->waveImage($amplitude, $wavelength);
$bg->rotateImage("white",-90);
$rand_angle=rand(1,7); // get random angle
$rand_sign=rand(0,1); // - +
if ($rand_sign == 0) { $rand_angle = - $rand_angle; }
$bg->rotateImage("white",$rand_angle);
return $bg->writeImages($filename, true);
At least for some time problem is solved so code could be later used to create plugin.
Articles that I used to achieve this effect in Zen Photo includes whole (great!) Mikko’s blog and
Imagick: Maintain (fake) transparency when saving as JPEG.
To create quote like on picture below you just need RMagick gem and two small functions.

Function that will return random number in range <-max, max> so image can be rotated in both ways.
# Custom random function, range <-max..max>
def crand max
if rand(2) == 0 then
mod = -1
else
mod = 1
end
(rand(max)+1)*mod
end
Function that will add border, wave, shadow and randomly rotate everything.
It expects Image object and can be used to add effect to any image.
# Slightly modified Polaroid effect
# Source: http://rmagick.rubyforge.org/Polaroid/polaroid.html
def create_card_effect image
image.border!(18, 18, "#fff")
image.border!(1,1,"#ddd")
image.background_color = "none"
amplitude = image.columns * 0.01
wavelength = image.rows * (rand(5)+5)
image.rotate!(90)
image = image.wave(amplitude, wavelength)
image.rotate!(-90)
shadow = image.flop
shadow = shadow.colorize(1, 1, 1, "gray75")
shadow.background_color = "white"
shadow.border!(10, 10, "white")
shadow = shadow.blur_image(0, 3)
image = shadow.composite(image, -amplitude/2, 5, Magick::OverCompositeOp)
image.rotate!(crand(10))
image.trim!
image
end
You can see how this is exactly done in quotes model by checking app/models/quote.rb file in Quotes app.
After getting fun with Coppermine Photo Gallery for some time I wanted to achieve polaroid-like effect (using ImageMagick) for thumbnails and intermediate pictures. Resulting effect is visible on picture below.

Using admin interface isn’t possible because of additional php code so it requires little code editing.
Open include/picmgmt.inc.php file and search for ImageMagick parameters then just edit it in similar way.
$rand_angle=rand(1,7); // get random angle
$rand_sign=rand(0,1); // - +
if ($rand_sign == 0) { $rand_angle = - $rand_angle; }
$cmd = "{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} ".$resize_commands." ".$unsharp_mask." $src_file -bordercolor white -border 6 -bordercolor grey60 -border 1 -background none -rotate {$rand_angle} -background black \( +clone -shadow 60x4+4+4 \) +swap -background white -flatten $im_dest_file";
exec ($cmd, $output, $retval);
For more examples look at ImageMagick examples and rebuild your images.