fixed null array issue when uploading images