Fixed a bug creating thumbnails for pictures