Seems to be quite a common question popping up recently… people are trying to delete their master page or page layout (or some other file) from the Master Page Gallery but keep getting the following error:
Even though you think you cleaned up all the places where a file is being used, I've yet to see a bug in MOSS that says a file is being used yet it really isn't. Chances are, you just missed one (or two). The easiest way to find where a file is being used is to go to the Site Content & Structure page via Site Actions » Manage Content and Structure. Then open up the Master Page Gallery. You'll notice a option in the toolbar: Show Related Resources. Select that item to create a split view. Now each item in the Master Page Gallery (shown in the top pane) has a radio button next to it. Selecting one will show you all the places that file is being used throughout the site collection.
Here's a screen shot of a particular page layout and where it is being used within my site collection: