This seems to be a somewhat intermittent problem to reproduce, but it's fairly easy to see what the cause is.
When bulk editing a lot of images, Batch API is used to set all the properties and rotate the images. In my situation, with just 5 images uploaded and attempting to rotate one of them, I get an "HTTP Error 500" during the batch operation. Checking the logs, I'm actually getting an undefined function node_gallery_api_batch_rotate().
The cause if this seems to be that batch_set() specifies several callback functions, but these callbacks are located in node_gallery_api.inc, which isn't always included. To fix this problem the "file" property should be used to point to the file that contains all the callbacks.