I had this problem.
Run the “Regenerate Thumbnails” process for each class of image:
Categories
Manufacturers
Suppliers
Scenes
Stores
Products (Do this one last as it probably has the most images)
Instead of timing out, you should get an error message showing which items have the problem. In my case we had 3 products with missing images.
Edit the products and delete any “ghost” images.
Re-run “Regenerate Thumbnails” for which ever class of image had the product, et voila!!!
Well, it worked for me.