Use RMagick and avoid tempfiles

Just keep everything in memory instead

cc @nakajima