Sometimes when creating a thumbnail image, getimagesize doesn't return
a value for bits per pixel on certain gifs. This creates warnings in
the logs when approximating the required memory consumption, and also
refuses to create the thumbnail. We can check the mimetype of the
image when 'bits' is not set, and when it's a gif, just assume the
maximum value (8 bpp).