Set size in local context if object size is valid