Fixed a bug that crashes the server when saving thumbnails