Added PIL support to get image dimensions