Fix handling of img_num in PIL Plugin

This addresses #1260.

Do NOT merge!  I need to add a test that loads all of the images in a gif, and one that loads by img_num.