Fixed a bug in picuture uploading code.