image allocation functions now pass around an extra userdata pointer