Illegal characters in file names
I've just found out that Gallery accepts files with all sorts of characters in the file name.
A user uploaded an image called moinho_#2.jpg and the image is broken because # are illegal.
Further tests show that it accepts almost every character you feed it.
A simple solution would be check the file name on upload and replace everything other than a-z, A-Z, 0-9, - and _ for underscores.
While this might not be such a big issue in english based sites, it is a very big problem with other languages like Portuguese, French, German, etc.