Fixed glitch when no resize required, removed image backend specificity

Changed generate function to use Image_Backend rather than GD so other
image libraries can be used. Fixed a bug where images that don't
require a resize caused a fatal error.