A constraint-based approach to shape management in multimedia databases