Fixes build against old imagemagick versions