Restrict image formats to the ones supported by PIL