Fix sort images error