Use RMagick instead of GD2 and Fix Pixel Point calculation